functions.sh: overwrite ABUILD_USERDIR from env

To be consistent with other variables ABUILD_USERDIR set from the
environment should be prefered over ABUILD_USERDIR set by the
ABUILD_CONF file.
This commit is contained in:
Sertonix 2024-04-29 14:56:18 +02:00
parent a45d12d4c3
commit a4dc880712
1 changed files with 3 additions and 2 deletions

View File

@ -64,7 +64,7 @@ hostspec_to_libc() {
}
readconfig() {
local _APORTSDIR _BUILDDIR _PKGDEST _SRCPKGDEST _REPODEST _SRCDEST
local _APORTSDIR _BUILDDIR _PKGDEST _SRCPKGDEST _REPODEST _SRCDEST _ABUILD_USERDIR
local _CC=gcc _CXX=g++ _LD=ld _CARCH _CHOST _CTARGET _CPPFLAGS _CFLAGS _CXXFLAGS _LDFLAGS
local _JOBS _MAKEFLAGS _PACKAGER _USE_COLORS _USE_CCACHE
local _BUILDCC _BUILDCXX _BUILDLD _BUILDCPPFLAGS _BUILDCXXFLAGS _BUILDCFLAGS
@ -76,6 +76,7 @@ readconfig() {
[ -n "${SRCPKGDEST+x}" ] && _SRCPKGDEST=$SRCPKGDEST
[ -n "${REPODEST+x}" ] && _REPODEST=$REPODEST
[ -n "${SRCDEST+x}" ] && _SRCDEST=$SRCDEST
[ -n "${ABUILD_USERDIR+x}" ] && _ABUILD_USERDIR=$ABUILD_USERDIR
[ -n "${CC+x}" ] && _CC=$CC
[ -n "${CXX+x}" ] && _CXX=$CXX
[ -n "${LD+x}" ] && _LD=$LD
@ -101,7 +102,7 @@ readconfig() {
[ -f "$ABUILD_DEFCONF" ] && . "$ABUILD_DEFCONF"
: ${ABUILD_CONF:=$sysconfdir/abuild.conf}
[ -f "$ABUILD_CONF" ] && . "$ABUILD_CONF"
: ${ABUILD_USERDIR:=$HOME/.abuild}
ABUILD_USERDIR=${_ABUILD_USERDIR-${ABUILD_USERDIR:-$HOME/.abuild}}
: ${ABUILD_USERCONF:=$ABUILD_USERDIR/abuild.conf}
[ -f "$ABUILD_USERCONF" ] && . "$ABUILD_USERCONF"
APORTSDIR=${_APORTSDIR-$APORTSDIR}