void-packages/common/hooks/pre-pkg/90-set-timestamps.sh
Enno Boland 3c04642877 environment/build: overwrite __DATE__, __TIME__, and __TIMESTAMP__ macros.
This commit overwrites timestamps that depend on timestamps with the
commit date of a package.
2016-03-01 15:33:09 +01:00

11 lines
390 B
Bash

# This hook executes the following tasks:
# - sets the timestamps in a package to the commit date
hook() {
# If XBPS_COMMIT_TIMESTAMP is set, set mtimes to that timestamp.
if [ -n "$XBPS_COMMIT_TIMESTAMP" ]; then
msg_normal "$pkgver: setting mtimes to %s\n" "$(date --date "$XBPS_COMMIT_TIMESTAMP")"
find $PKGDESTDIR -print0 | xargs -0 touch -h --date "$XBPS_COMMIT_TIMESTAMP"
fi
}