summaryrefslogtreecommitdiff
path: root/functions.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'functions.sh.in')
-rw-r--r--functions.sh.in11
1 files changed, 8 insertions, 3 deletions
diff --git a/functions.sh.in b/functions.sh.in
index 557f9a8..1295ee2 100644
--- a/functions.sh.in
+++ b/functions.sh.in
@@ -65,7 +65,7 @@ hostspec_to_libc() {
readconfig() {
local _APORTSDIR _BUILDDIR _PKGDEST _SRCPKGDEST _REPODEST _SRCDEST
local _CARCH _CHOST _CTARGET _CPPFLAGS _CFLAGS _CXXFLAGS _LDFLAGS
- local _JOBS _MAKEFLAGS _PACKAGER _USE_COLORS
+ local _JOBS _MAKEFLAGS _PACKAGER _USE_COLORS _ABUILD_GIT
local gitbase=
[ -n "${APORTSDIR+x}" ] && _APORTSDIR=$APORTSDIR
[ -n "${BUILDDIR+x}" ] && _BUILDDIR=$BUILDDIR
@@ -84,20 +84,25 @@ readconfig() {
[ -n "${MAKEFLAGS+x}" ] && _MAKEFLAGS=$MAKEFLAGS
[ -n "${PACKAGER+x}" ] && _PACKAGER=$PACKAGER
[ -n "${USE_COLORS+x}" ] && _USE_COLORS="$USE_COLORS"
+ [ -n "${ABUILD_GIT+x}" ] && _ABUILD_GIT=$ABUILD_GIT
: ${ABUILD_CONF:=$sysconfdir/abuild.conf}
: ${ABUILD_USERDIR:=$HOME/.abuild}
: ${ABUILD_USERCONF:=$ABUILD_USERDIR/abuild.conf}
[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
[ -f "$ABUILD_USERCONF" ] && . "$ABUILD_USERCONF"
+ ABUILD_GIT=${_ABUILD_GIT-$ABUILD_GIT}
+ if [ -z "$ABUILD_GIT" ]; then
+ ABUILD_GIT=$(command -v git) || ABUILD_GIT=true
+ fi
APORTSDIR=${_APORTSDIR-$APORTSDIR}
- gitbase=$(git rev-parse --show-toplevel 2>/dev/null) || true # already is -P
+ gitbase=$($ABUILD_GIT rev-parse --show-toplevel 2>/dev/null) || true # already is -P
if [ -d "$APORTSDIR" ]; then
APORTSDIR=$(cd "$APORTSDIR"; pwd -P)
elif [ -z "$APORTSDIR" ] && [ -d "$HOME/aports" ]; then
APORTSDIR=$(cd "$HOME/aports"; pwd -P)
else
if [ -n "$gitbase" ]; then
- case $(git config remote.origin.url) in
+ case $($ABUILD_GIT config remote.origin.url) in
*/aports) APORTSDIR=$gitbase ;;
*) APORTSDIR= ;;
esac