xbps-src; export XBPS_GIT_CMD, defaulting to chroot-git and fallback on

git.
This commit is contained in:
maxice8 2019-03-06 23:26:54 -03:00 committed by Michael Aldridge
parent 81e021bd8a
commit 93a0a93ea9
1 changed files with 13 additions and 1 deletions

View File

@ -270,7 +270,7 @@ check_build_requirements() {
if [ -n "$IN_CHROOT" ]; then
_gitbranch="$(chroot-git symbolic-ref --short HEAD 2>/dev/null)"
else
_gitbranch="$(git symbolic-ref --short HEAD 2>/dev/null)"
_gitbranch="$($XBPS_GIT_CMD symbolic-ref --short HEAD 2>/dev/null)"
fi
if [ -n "${_gitbranch}" -a "${_gitbranch}" != "master" ]; then
export XBPS_ALT_REPOSITORY="${_gitbranch}"
@ -477,6 +477,18 @@ readonly REQHOST_UTILS="xbps-install xbps-query xbps-rindex xbps-uhelper \
check_reqhost_utils
# Try using chroot-git then git from the host system
if command -v chroot-git &>/dev/null; then
XBPS_GIT_CMD=$(command -v chroot-git)
elif command -v git &>/dev/null; then
XBPS_GIT_CMD=$(command -v git)
else
echo "neither chroot-git or git are available in your system!"
exit 1
fi
readonly XBPS_GIT_CMD
if [ -n "$IN_CHROOT" ]; then
readonly XBPS_CONFIG_FILE=/etc/xbps/xbps-src.conf
readonly XBPS_DISTDIR=/void-packages