diff options
author | Sören Tempel <soeren+git@soeren-tempel.net> | 2019-11-14 10:37:52 +0100 |
---|---|---|
committer | Sören Tempel <soeren+git@soeren-tempel.net> | 2019-11-14 10:52:15 +0100 |
commit | 9a4b8f04dafaa8ac635ac285f1ea3123ef510f93 (patch) | |
tree | 78bf45002cbab6ea882ce928c0926e829c5e1574 /main/abuild/0001-abuild-Fix-abuild-rootbld.patch | |
parent | f0daafa26104492bf41371cccf3a324f02aa66ec (diff) | |
download | aports-9a4b8f04dafaa8ac635ac285f1ea3123ef510f93.tar.bz2 aports-9a4b8f04dafaa8ac635ac285f1ea3123ef510f93.tar.xz |
main/abuild: fix abuild rootbld
See https://gitlab.alpinelinux.org/alpine/abuild/issues/9978
Diffstat (limited to 'main/abuild/0001-abuild-Fix-abuild-rootbld.patch')
-rw-r--r-- | main/abuild/0001-abuild-Fix-abuild-rootbld.patch | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/main/abuild/0001-abuild-Fix-abuild-rootbld.patch b/main/abuild/0001-abuild-Fix-abuild-rootbld.patch new file mode 100644 index 0000000000..18dd4bb36c --- /dev/null +++ b/main/abuild/0001-abuild-Fix-abuild-rootbld.patch @@ -0,0 +1,71 @@ +From 918b7b19206927b416bcc13bcb80a8f7d2c78c41 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net> +Date: Wed, 13 Nov 2019 18:15:28 +0100 +Subject: [PATCH] abuild: Fix abuild rootbld + +Without this change abuild rootbld would fail with: + + touch: invalid date '@' + +Because SOURCE_DATE_EPOCH wasn't set when abuild rootbld was used. This +is a bug introduced in 71d9d5233b9db3be91510addcb28721545d93185. Instead +of reverting the aforementioned commit move the SOURCE_DATE_EPOCH +initialization to a custom function and also call it from the abuild +rootbld function. + +Fixes #9978 +--- + abuild.in | 26 +++++++++++++++++--------- + 1 file changed, 17 insertions(+), 9 deletions(-) + +diff --git a/abuild.in b/abuild.in +index 91f9e1d..29a87c6 100644 +--- a/abuild.in ++++ b/abuild.in +@@ -104,6 +104,18 @@ want_check() { + return 0 + } + ++set_source_date() { ++ # set time stamp for reproducible builds ++ export ABUILD_LAST_COMMIT="$(git_last_commit)$(git_dirty)" ++ if [ -z "$SOURCE_DATE_EPOCH" ] && [ "${ABUILD_LAST_COMMIT%-dirty}" = "$ABUILD_LAST_COMMIT" ]; then ++ SOURCE_DATE_EPOCH=$(git_last_commit_epoch $ABUILD_LAST_COMMIT) ++ fi ++ if [ -z "$SOURCE_DATE_EPOCH" ]; then ++ SOURCE_DATE_EPOCH=$(date -u "+%s") ++ fi ++ export SOURCE_DATE_EPOCH ++} ++ + default_cleanup_srcdir() { + if options_has "chmod-clean" && test -d "$srcdir"; then + chmod -R +w "$srcdir" +@@ -1601,15 +1613,8 @@ build_abuildrepo() { + local _starttime=$(date --utc +%s) + msg "Building $repo/$pkgname $pkgver-r$pkgrel (using $program $program_version) started $(date -R)" + +- # set time stamp for reproducible builds +- export ABUILD_LAST_COMMIT="$(git_last_commit)$(git_dirty)" +- if [ -z "$SOURCE_DATE_EPOCH" ] && [ "${ABUILD_LAST_COMMIT%-dirty}" = "$ABUILD_LAST_COMMIT" ]; then +- SOURCE_DATE_EPOCH=$(git_last_commit_epoch $ABUILD_LAST_COMMIT) +- fi +- if [ -z "$SOURCE_DATE_EPOCH" ]; then +- SOURCE_DATE_EPOCH=$(date -u "+%s") +- fi +- export SOURCE_DATE_EPOCH ++ # make sure SOURCE_DATE_EPOCH is set ++ set_source_date + + for part in sanitycheck builddeps clean fetch unpack prepare mkusers build \ + $_check rootpkg; do +@@ -2159,6 +2164,9 @@ rootbld() { + # check early if we have abuild key + abuild-sign --installed + ++ # make sure SOURCE_DATE_EPOCH is set ++ set_source_date ++ + # networking business + sanitycheck + clean |