Prefer flags over config file, again

This commit is contained in:
Piotr Wójcik 2020-09-09 23:20:27 +02:00 committed by Daniel Kolesa
parent da1089042f
commit 46cb66d525

View file

@ -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