From 4ac333c3b19961da605facc590e8c431aee8f4b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Mon, 22 Feb 2021 21:24:47 +0100 Subject: [PATCH] xbps-src: allow to run without git This makes possible to binary-bootstrap and build packages with only base-system using tarball of void-packages. --- common/environment/setup/git.sh | 4 +++- etc/defaults.conf | 2 +- xbps-src | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/common/environment/setup/git.sh b/common/environment/setup/git.sh index 13e5178ccf..4b352fe538 100644 --- a/common/environment/setup/git.sh +++ b/common/environment/setup/git.sh @@ -2,7 +2,9 @@ # 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" + if [ -z "$XBPS_USE_BUILD_MTIME" ] || [ -n "$XBPS_USE_GIT_REVS" ]; then + msg_error "BUG: environment/setup: XBPS_GIT_CMD is not set\n" + fi fi if [ -n "$XBPS_USE_BUILD_MTIME" ]; then diff --git a/etc/defaults.conf b/etc/defaults.conf index bc93457747..133449a150 100644 --- a/etc/defaults.conf +++ b/etc/defaults.conf @@ -132,7 +132,7 @@ XBPS_SUCMD="sudo /bin/sh -c" # [OPTIONAL] # Enable to use the standard mtime of files. Otherwise it will be rewritten to -# the HEAD commit time. +# the HEAD commit time. Requires git when disabled. # #XBPS_USE_BUILD_MTIME=yes diff --git a/xbps-src b/xbps-src index ecd389b93e..a488ed3f84 100755 --- a/xbps-src +++ b/xbps-src @@ -513,7 +513,7 @@ 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) -else +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 fi