void-packages/common/environment/setup/git.sh
2020-05-23 06:59:24 +00:00

17 lines
700 B
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# If XBPS_USE_BUILD_MTIME is enabled in conf file don't continue.
# only run this, if SOURCE_DATE_EPOCH isn't set.
if [ -z "$XBPS_GIT_CMD" ]; then
msg_error "BUG: environment/setup: XBPS_GIT_CMD is not set\n"
fi
if [ -n "$XBPS_USE_BUILD_MTIME" ]; then
unset SOURCE_DATE_EPOCH
elif [ -z "${SOURCE_DATE_EPOCH}" -a -n "$IN_CHROOT" ]; then
# check if the template is under version control:
if $XBPS_GIT_CMD -C ${XBPS_SRCPKGDIR}/${basepkg} status -u normal --porcelain template | grep "^?? " &> /dev/null; then
export SOURCE_DATE_EPOCH="$(stat -c %Y ${XBPS_SRCPKGDIR}/${basepkg}/template)"
else
export SOURCE_DATE_EPOCH="$($XBPS_GIT_CMD -C ${XBPS_DISTDIR} log --pretty='%ct' -n1 HEAD)"
fi
fi