From 07cc9e1787e702160b94be1a5dedbe9a85be2604 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 13 Feb 2024 22:18:26 +0700 Subject: [PATCH] xbps-src: stop invoking chroot-git explicitly Use /usr/libexec/chroot-git/git instead. Honestly, I think xbps-src stop using chroot-git directly for a while, since xbps-src invoke git to retrieve metadata outside of chroot in order to support git's worktree. --- xbps-src | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xbps-src b/xbps-src index 8c104dfcf4e..f8c21b3b927 100755 --- a/xbps-src +++ b/xbps-src @@ -568,13 +568,14 @@ if [ -d "$XBPS_MASTERDIR" -a ! -w "$XBPS_MASTERDIR" ]; then fi # Try using chroot-git then git from the host system -if command -v chroot-git &>/dev/null; then - export XBPS_GIT_CMD=$(command -v chroot-git) -elif command -v git &>/dev/null; then - export XBPS_GIT_CMD=$(command -v git) +XBPS_GIT_CMD="$(PATH="/usr/libexec/chroot-git:$PATH:$XBPS_MASTERDIR/usr/libexec/chroot-git" command -v git 2>/dev/null)" +if [ -n "$XBPS_GIT_CMD" ]; then + export XBPS_GIT_CMD elif [ -z "$XBPS_USE_BUILD_MTIME" ] || [ "$XBPS_USE_GIT_REVS" ]; then echo "neither chroot-git or git are available in your system!" 1>&2 exit 1 +else + unset XBPS_GIT_CMD fi if [ -n "$XBPS_HOSTDIR" ]; then