2019-11-23 09:33:32 +01:00
|
|
|
# This hook generates a file ${XBPS_STATEDIR}/gitrev with the last
|
|
|
|
# commit sha1 (in short mode) for source pkg if XBPS_USE_GIT_REVS is enabled.
|
2014-03-02 08:33:28 +01:00
|
|
|
|
|
|
|
hook() {
|
2014-12-11 11:02:22 +01:00
|
|
|
local GITREVS_FILE=${XBPS_STATEDIR}/gitrev
|
2014-03-02 08:33:28 +01:00
|
|
|
|
|
|
|
# If XBPS_USE_GIT_REVS is disabled in conf file don't continue.
|
|
|
|
if [ -z $XBPS_USE_GIT_REVS ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
# If the file exists don't regenerate it again.
|
|
|
|
if [ -s ${GITREVS_FILE} ]; then
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2020-04-21 17:52:38 +02:00
|
|
|
if [ -z "$XBPS_GIT_REVS" ]; then
|
|
|
|
msg_error "BUG: XBPS_GIT_REVS is not set\n"
|
2014-08-26 07:53:31 +02:00
|
|
|
fi
|
|
|
|
|
2014-06-27 12:00:24 +02:00
|
|
|
cd $XBPS_SRCPKGDIR
|
2020-04-21 17:52:38 +02:00
|
|
|
echo "${sourcepkg}:${XBPS_GIT_REVS}"
|
|
|
|
echo "${sourcepkg}:${XBPS_GIT_REVS}" > $GITREVS_FILE
|
2014-03-02 08:33:28 +01:00
|
|
|
}
|