xbps-src: make build options from config ang flags work together

Flag options was appended to XBPS_PKG_OPTIONS, but was later
overwritten by sourcing config. Instead, pass only flags
options in separate variable and join at very end.
This commit is contained in:
Piotr Wójcik 2020-08-28 19:19:13 +02:00 committed by Piotr
parent 52781a35fe
commit 15e7a92951
2 changed files with 11 additions and 10 deletions

View File

@ -167,6 +167,16 @@ set_build_options() {
if [ -z "$pkgopts" -o "$pkgopts" = "" ]; then if [ -z "$pkgopts" -o "$pkgopts" = "" ]; then
pkgopts=${XBPS_PKG_OPTIONS} pkgopts=${XBPS_PKG_OPTIONS}
fi fi
# If pkg options were set in config(s), merge them with command line
if [ -n "$XBPS_ARG_PKG_OPTIONS" ]; then
if [ -n "$pkgopts" ]; then
pkgopts+=",$XBPS_ARG_PKG_OPTIONS"
else
pkgopts="$XBPS_ARG_PKG_OPTIONS"
fi
fi
OIFS="$IFS"; IFS=',' OIFS="$IFS"; IFS=','
for j in ${pkgopts}; do for j in ${pkgopts}; do
case "$j" in case "$j" in

View File

@ -485,15 +485,6 @@ if [ -z "$IN_CHROOT" ]; then
export XBPS_HOSTDIR="$(readlink -f $XBPS_HOSTDIR 2>/dev/null)" export XBPS_HOSTDIR="$(readlink -f $XBPS_HOSTDIR 2>/dev/null)"
fi fi
# If pkg options were set in config(s), merge them with command line
if [ -n "$XBPS_ARG_PKG_OPTIONS" ]; then
if [ -n "$XBPS_PKG_OPTIONS" ]; then
export XBPS_PKG_OPTIONS+=",$XBPS_ARG_PKG_OPTIONS"
else
export XBPS_PKG_OPTIONS="$XBPS_ARG_PKG_OPTIONS"
fi
fi
# Forbid root unless XBPS_ALLOW_CHROOT_BREAKOUT is set # Forbid root unless XBPS_ALLOW_CHROOT_BREAKOUT is set
# (for travis CI). # (for travis CI).
if [ -z "$IN_CHROOT" -a "$UID" -eq 0 -a -z "$XBPS_ALLOW_CHROOT_BREAKOUT" ]; then if [ -z "$IN_CHROOT" -a "$UID" -eq 0 -a -z "$XBPS_ALLOW_CHROOT_BREAKOUT" ]; then
@ -636,7 +627,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
XBPS_CPPFLAGS XBPS_CFLAGS XBPS_CXXFLAGS XBPS_FFLAGS XBPS_LDFLAGS \ XBPS_CPPFLAGS XBPS_CFLAGS XBPS_CXXFLAGS XBPS_FFLAGS XBPS_LDFLAGS \
XBPS_MAKEJOBS XBPS_BUILD_FORCEMODE XBPS_USE_GIT_REVS XBPS_DEBUG_PKGS \ XBPS_MAKEJOBS XBPS_BUILD_FORCEMODE XBPS_USE_GIT_REVS XBPS_DEBUG_PKGS \
XBPS_CHECK_PKGS XBPS_CCACHE XBPS_DISTCC XBPS_DISTCC_HOSTS XBPS_SKIP_DEPS \ XBPS_CHECK_PKGS XBPS_CCACHE XBPS_DISTCC XBPS_DISTCC_HOSTS XBPS_SKIP_DEPS \
XBPS_SKIP_REMOTEREPOS XBPS_CROSS_BUILD XBPS_PKG_OPTIONS XBPS_CONFIG_FILE \ XBPS_SKIP_REMOTEREPOS XBPS_CROSS_BUILD XBPS_ARG_PKG_OPTIONS XBPS_CONFIG_FILE \
XBPS_KEEP_ALL XBPS_HOSTDIR XBPS_MASTERDIR XBPS_SRC_VERSION \ XBPS_KEEP_ALL XBPS_HOSTDIR XBPS_MASTERDIR XBPS_SRC_VERSION \
XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \ XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \
XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \ XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \