public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-portage-dev] [PATCH 2/2] econf: Add EAPI-conditional arguments via array
  @ 2014-08-17 18:00 99% ` Michał Górny
  0 siblings, 0 replies; 1+ results
From: Michał Górny @ 2014-08-17 18:00 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Michał Górny

Use a dedicated array variable to add EAPI-conditional arguments to
the configure script instead of prepending them to the command
parameters.
---
 bin/phase-helpers.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 6a5ce85..b96c3f5 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -521,18 +521,19 @@ econf() {
 			done
 		fi
 
+		local conf_args=()
 		if ___eapi_econf_passes_--disable-dependency-tracking || ___eapi_econf_passes_--disable-silent-rules; then
 			local conf_help=$("${ECONF_SOURCE}/configure" --help 2>/dev/null)
 
 			if ___eapi_econf_passes_--disable-dependency-tracking; then
 				if [[ ${conf_help} == *--disable-dependency-tracking* ]]; then
-					set -- --disable-dependency-tracking "$@"
+					conf_args+=( --disable-dependency-tracking )
 				fi
 			fi
 
 			if ___eapi_econf_passes_--disable-silent-rules; then
 				if [[ ${conf_help} == *--disable-silent-rules* ]]; then
-					set -- --disable-silent-rules "$@"
+					conf_args+=( --disable-silent-rules )
 				fi
 			fi
 		fi
@@ -550,7 +551,9 @@ econf() {
 			CONF_PREFIX=${CONF_PREFIX#*=}
 			[[ ${CONF_PREFIX} != /* ]] && CONF_PREFIX="/${CONF_PREFIX}"
 			[[ ${CONF_LIBDIR} != /* ]] && CONF_LIBDIR="/${CONF_LIBDIR}"
-			set -- --libdir="$(__strip_duplicate_slashes "${CONF_PREFIX}${CONF_LIBDIR}")" "$@"
+			conf_args+=(
+				--libdir="$(__strip_duplicate_slashes "${CONF_PREFIX}${CONF_LIBDIR}")"
+			)
 		fi
 
 		# Handle arguments containing quoted whitespace (see bug #457136).
@@ -566,6 +569,7 @@ econf() {
 			--datadir="${EPREFIX}"/usr/share \
 			--sysconfdir="${EPREFIX}"/etc \
 			--localstatedir="${EPREFIX}"/var/lib \
+			"${conf_args[@]}" \
 			"$@" \
 			"${EXTRA_ECONF[@]}"
 		__vecho "${ECONF_SOURCE}/configure" "$@"
-- 
2.0.4



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2014-08-17 18:00     [gentoo-portage-dev] [PATCH 1/2] econf: Replace unnecessary 'case' statements with 'if's Michał Górny
2014-08-17 18:00 99% ` [gentoo-portage-dev] [PATCH 2/2] econf: Add EAPI-conditional arguments via array Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox