summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
Diffstat (limited to 'abuild.in')
-rw-r--r--abuild.in18
1 files changed, 13 insertions, 5 deletions
diff --git a/abuild.in b/abuild.in
index 729a400..a7ece85 100644
--- a/abuild.in
+++ b/abuild.in
@@ -30,11 +30,6 @@ fi
apk_opt_wait="--wait 30"
-if [ -z "$SOURCE_DATE_EPOCH" ]; then
- SOURCE_DATE_EPOCH=$(date -u "+%s")
-fi
-export SOURCE_DATE_EPOCH
-
umask 022
shell_escape() {
@@ -872,6 +867,11 @@ git_last_commit() {
$git log --format=oneline -n 1 "$startdir" | awk '{print $1}'
}
+# date of last commit
+git_last_commit_epoch() {
+ $git log -1 --format=%cd --date=unix -- "$startdir"
+}
+
get_maintainer() {
if [ -z "$maintainer" ]; then
maintainer=$(awk -F': ' '/# *Maintainer/ {print $2}' "$APKBUILD")
@@ -2548,6 +2548,14 @@ BUILD_ROOT=
export CC CXX
+if [ -z "$SOURCE_DATE_EPOCH" ]; then
+ SOURCE_DATE_EPOCH=$(git_last_commit_epoch)
+fi
+if [ -z "$SOURCE_DATE_EPOCH" ]; then
+ SOURCE_DATE_EPOCH=$(date -u "+%s")
+fi
+export SOURCE_DATE_EPOCH
+
cd "$startdir" || die
. "$APKBUILD"