aboutsummaryrefslogtreecommitdiff
path: root/common/hooks
diff options
context:
space:
mode:
authorĐoàn Trần Công Danh <congdanhqx+sgn@gmail.com>2020-04-22 13:59:26 +0000
committerDanh Doan <congdanhqx@gmail.com>2020-05-23 06:59:24 +0000
commit20f9bedefb2cbf01879f98120a1e0ebc412ac0c5 (patch)
tree458f13d5c7a7c6f894d76f2b965daed5687ade15 /common/hooks
parentf1773b77922526619a14a099d4023ec8c95e7487 (diff)
downloadvoid-packages-20f9bedefb2cbf01879f98120a1e0ebc412ac0c5.tar
void-packages-20f9bedefb2cbf01879f98120a1e0ebc412ac0c5.tar.gz
void-packages-20f9bedefb2cbf01879f98120a1e0ebc412ac0c5.tar.bz2
void-packages-20f9bedefb2cbf01879f98120a1e0ebc412ac0c5.tar.lz
void-packages-20f9bedefb2cbf01879f98120a1e0ebc412ac0c5.tar.xz
void-packages-20f9bedefb2cbf01879f98120a1e0ebc412ac0c5.tar.zst
void-packages-20f9bedefb2cbf01879f98120a1e0ebc412ac0c5.zip
xbps-src: use $XBPS_GIT_CMD for git
Diffstat (limited to 'common/hooks')
-rw-r--r--common/hooks/post-install/05-generate-gitrevs.sh12
1 files changed, 4 insertions, 8 deletions
diff --git a/common/hooks/post-install/05-generate-gitrevs.sh b/common/hooks/post-install/05-generate-gitrevs.sh
index 82b2ab1a786..754ba8865b9 100644
--- a/common/hooks/post-install/05-generate-gitrevs.sh
+++ b/common/hooks/post-install/05-generate-gitrevs.sh
@@ -3,7 +3,7 @@
hook() {
local GITREVS_FILE=${XBPS_STATEDIR}/gitrev
- local GIT_CMD rev
+ local rev
# If XBPS_USE_GIT_REVS is disabled in conf file don't continue.
if [ -z $XBPS_USE_GIT_REVS ]; then
@@ -14,16 +14,12 @@ hook() {
return
fi
- if command -v chroot-git &>/dev/null; then
- GIT_CMD=$(command -v chroot-git)
- elif command -v git &>/dev/null; then
- GIT_CMD=$(command -v git)
- else
- msg_error "$pkgver: cannot find chroot-git or git utility, exiting...\n"
+ if [ -z "$XBPS_GIT_CMD" ]; then
+ msg_error "BUG: post-install: XBPS_GIT_CMD is not set\n"
fi
cd $XBPS_SRCPKGDIR
- rev="$($GIT_CMD rev-parse --short HEAD)"
+ rev="$($XBPS_GIT_CMD rev-parse --short HEAD)"
echo "${sourcepkg}:${rev}"
echo "${sourcepkg}:${rev}" > $GITREVS_FILE
}