From c43a0419029a3a3731a64b1c7d42ca88abfb9f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Wed, 9 Sep 2020 23:20:27 +0200 Subject: [PATCH] Prefer flags over config file, again --- common/xbps-src/shutils/common.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index db97a212354..4e5e83f416a 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -162,11 +162,14 @@ set_build_options() { fi for f in ${build_options}; do - _pkgname=${pkgname//[^A-Za-z0-9_]/_} - eval pkgopts="\$XBPS_PKG_OPTIONS_${_pkgname}" - if [ -z "$pkgopts" -o "$pkgopts" = "" ]; then - pkgopts=${XBPS_PKG_OPTIONS} - fi + # Select build options from conf + export XBPS_CURRENT_PKG=${pkgname} + pkgopts="$( + . $XBPS_CONFIG_FILE 2>/dev/null + var="XBPS_PKG_OPTIONS_${XBPS_CURRENT_PKG//[^A-Za-z0-9_]/_}" + echo ${!var:-${XBPS_PKG_OPTIONS}} + )" + unset XBPS_CURRENT_PKG # If pkg options were set in config(s), merge them with command line if [ -n "$XBPS_ARG_PKG_OPTIONS" ]; then @@ -336,8 +339,6 @@ setup_pkg() { unset_package_funcs - . $XBPS_CONFIG_FILE 2>/dev/null - if [ -n "$cross" ]; then source_file $XBPS_CROSSPFDIR/${cross}.sh