Compare commits

..

No commits in common. "factory" and "factory" have entirely different histories.

3 changed files with 1 additions and 49 deletions

View File

@ -1,8 +1,3 @@
-------------------------------------------------------------------
Sat Feb 15 04:06:34 UTC 2025 - Bernhard Wiedemann <bwiedemann@suse.com>
- Add reproducible.patch to override build date (boo#1047218)
-------------------------------------------------------------------
Sat Jan 6 16:23:45 UTC 2024 - Dirk Müller <dmueller@suse.com>

View File

@ -23,7 +23,6 @@ Summary: A make-like build tool using Go
License: Apache-2.0
URL: https://github.com/magefile/mage
Source: https://github.com/magefile/mage/archive/refs/tags/v%{version}.tar.gz
Patch0: https://github.com/magefile/mage/pull/474.patch#/reproducible.patch
BuildRequires: go
BuildRequires: golang-packaging
BuildRequires: golang(API) >= 1.12
@ -33,7 +32,7 @@ BuildRequires: golang(API) >= 1.12
Mage is a make-like build tool using Go. You write plain-old go functions, and Mage automatically uses them as Makefile-like runnable targets.
%prep
%autosetup -p1
%setup -q
%build
if test -z "$GOPATH"; then

View File

@ -1,42 +0,0 @@
From fbeaad11b0452a336cc23545aee709e811fdb9cc Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
Date: Sun, 25 Jun 2023 09:33:48 +0200
Subject: [PATCH] Allow to override build date with SOURCE_DATE_EPOCH
in order to make builds reproducible.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
This patch was done while working on reproducible builds for openSUSE.
---
magefile.go | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/magefile.go b/magefile.go
index c08ffa37..ab91e4fe 100644
--- a/magefile.go
+++ b/magefile.go
@@ -14,6 +14,7 @@ import (
"path/filepath"
"regexp"
"runtime"
+ "strconv"
"strings"
"time"
@@ -100,6 +101,14 @@ func Clean() error {
func flags() string {
timestamp := time.Now().Format(time.RFC3339)
+ source_date_epoch := os.Getenv("SOURCE_DATE_EPOCH")
+ if source_date_epoch != "" {
+ sde, err := strconv.ParseInt(source_date_epoch, 10, 64)
+ if err != nil {
+ panic(fmt.Sprintf("Invalid SOURCE_DATE_EPOCH: %s", err))
+ }
+ timestamp = time.Unix(sde, 0).UTC().Format(time.RFC3339)
+ }
hash := hash()
tag := tag()
if tag == "" {