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.
This commit is contained in:
Piotr Wójcik 2021-02-22 21:24:47 +01:00 committed by Piotr
parent 9154902b27
commit 4ac333c3b1
3 changed files with 5 additions and 3 deletions

View file

@ -2,7 +2,9 @@
# only run this, if SOURCE_DATE_EPOCH isn't set. # only run this, if SOURCE_DATE_EPOCH isn't set.
if [ -z "$XBPS_GIT_CMD" ]; then 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 fi
if [ -n "$XBPS_USE_BUILD_MTIME" ]; then if [ -n "$XBPS_USE_BUILD_MTIME" ]; then

View file

@ -132,7 +132,7 @@ XBPS_SUCMD="sudo /bin/sh -c"
# [OPTIONAL] # [OPTIONAL]
# Enable to use the standard mtime of files. Otherwise it will be rewritten to # 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 #XBPS_USE_BUILD_MTIME=yes

View file

@ -513,7 +513,7 @@ if command -v chroot-git &>/dev/null; then
export XBPS_GIT_CMD=$(command -v chroot-git) export XBPS_GIT_CMD=$(command -v chroot-git)
elif command -v git &>/dev/null; then elif command -v git &>/dev/null; then
export XBPS_GIT_CMD=$(command -v git) 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 echo "neither chroot-git or git are available in your system!" 1>&2
exit 1 exit 1
fi fi