summaryrefslogtreecommitdiff
path: root/scripts/makepkg.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/makepkg.sh.in')
-rw-r--r--scripts/makepkg.sh.in13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 20e9dd7e..a466e4f1 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -79,6 +79,7 @@ PKGFUNC=0
PKGVERFUNC=0
PREPAREFUNC=0
REPKG=0
+REPRODUCIBLE=0
RMDEPS=0
SKIPCHECKSUMS=0
SKIPPGPCHECK=0
@@ -87,7 +88,12 @@ SPLITPKG=0
SOURCEONLY=0
VERIFYSOURCE=0
-export SOURCE_DATE_EPOCH=${SOURCE_DATE_EPOCH:-$(date +%s)}
+if [[ -n $SOURCE_DATE_EPOCH ]]; then
+ REPRODUCIBLE=1
+else
+ SOURCE_DATE_EPOCH=$(date +%s)
+fi
+export SOURCE_DATE_EPOCH
PACMAN_OPTS=()
@@ -1686,6 +1692,11 @@ if (( !REPKG )); then
if (( PREPAREFUNC )); then
run_prepare
fi
+ if (( REPRODUCIBLE )); then
+ # We have activated reproducible builds, so unify source times before
+ # building
+ find "$srcdir" -exec touch -h -d @$SOURCE_DATE_EPOCH {} +
+ fi
fi
if (( PKGVERFUNC )); then