abuild: use timestamp of APKBUILD if not in git

we normally use the last git commit timestamp for creating reproducible
builds. Fall back to APKBUILD timestamp if there are no git commits.
This commit is contained in:
Natanael Copa 2022-06-20 11:52:00 +02:00
parent e684847caf
commit e25a2b6fc5

View File

@ -120,7 +120,7 @@ set_source_date() {
SOURCE_DATE_EPOCH=$(git_last_commit_epoch $ABUILD_LAST_COMMIT)
fi
if [ -z "$SOURCE_DATE_EPOCH" ]; then
SOURCE_DATE_EPOCH=$(date -u "+%s")
SOURCE_DATE_EPOCH=$(stat -c "%Y" "$APKBUILD")
fi
export SOURCE_DATE_EPOCH
}