2009-07-05 13:36:24 David Leverton napisaƂ(a):
> On Sunday 05 July 2009 03:33:54 Arfrever Frehtes Taifersar Arahesis wrote:
> > I would like to suggest that values of IUSE_* variables (whose names end
> > with values of USE_EXPAND variable), after prefixing with lower-cased names
> > of appropriate variables included in USE_EXPAND, should be automatically
> > added to IUSE variable.
> 
> USE_EXPAND is set in the profiles, so it can't be used during metadata 
> generation.

OK. I think that the proposed new behavior could concern all IUSE_* variables 
(maybe except IUSE_IMPLICIT).

> > It's a zero-cost feature implemented in the attached patch, so including it
> > in EAPI=3 (after temporary unlocking of list of features of EAPI=3)
> > wouldn't delay implementing support for EAPI=3 in Portage.
> 
> http://www.gentoo.org/proj/en/council/meeting-logs/20090409-summary.txt

Council can vote on changing of its previous decisions.

-- 
Arfrever Frehtes Taifersar Arahesis
Index: bin/ebuild.sh
===================================================================
--- bin/ebuild.sh	(revision 13805)
+++ bin/ebuild.sh	(working copy)
@@ -1182,6 +1182,24 @@
 	debug-print "now in section $*"
 }
 
+expand_IUSE() {
+	if ! has "${EAPI:-0}" 0 1 2 ; then
+		local var flag flag_prefix
+		for var in ${!IUSE_*} ; do
+			if [[ $var != IUSE_IMPLICIT ]] ; then
+				for flag in ${!var} ; do
+					flag_prefix=
+					if [[ ${flag:0:1} == [+-] ]] ; then
+						flag_prefix=${flag:0:1}
+						flag=${flag:1}
+					fi
+					IUSE="$IUSE $flag_prefix$(echo ${var#IUSE_} | LC_ALL=C tr [:upper:] [:lower:])_$flag"
+				done
+			fi
+		done
+	fi
+}
+
 # Sources all eclasses in parameters
 declare -ix ECLASS_DEPTH=0
 inherit() {
@@ -1268,6 +1286,8 @@
 		#turn off glob expansion
 		set -f
 
+		expand_IUSE
+
 		# If each var has a value, append it to the global variable E_* to
 		# be applied after everything is finished. New incremental behavior.
 		[ "${IUSE-unset}"    != "unset" ] && export E_IUSE="${E_IUSE} ${IUSE}"
@@ -1785,6 +1805,12 @@
 	# eclasses, they need to be unset before this process of
 	# interaction begins.
 	unset DEPEND RDEPEND PDEPEND IUSE
+	local var
+	for var in ${!IUSE_*} ; do
+		if [[ $var != IUSE_IMPLICIT ]] ; then
+			unset $var
+		fi
+	done
 	source "${EBUILD}" || die "error sourcing ebuild"
 
 	if [ "${EBUILD_PHASE}" != "depend" ] ; then
@@ -1808,6 +1834,8 @@
 
 	unset ECLASS E_IUSE E_DEPEND E_RDEPEND E_PDEPEND
 
+	expand_IUSE
+
 	# alphabetically ordered by $EBUILD_PHASE value
 	local f valid_phases
 	case "$EAPI" in
Index: bin/isolated-functions.sh
===================================================================
--- bin/isolated-functions.sh	(revision 13805)
+++ bin/isolated-functions.sh	(working copy)
@@ -512,8 +512,8 @@
 			abort_test abort_install dyn_prepare dyn_configure \
 			dyn_compile dyn_test dyn_install \
 			dyn_preinst dyn_help debug-print debug-print-function \
-			debug-print-section inherit EXPORT_FUNCTIONS newdepend newrdepend \
-			newpdepend do_newdepend remove_path_entry \
+			debug-print-section expand_IUSE inherit EXPORT_FUNCTIONS \
+			newdepend newrdepend newpdepend do_newdepend remove_path_entry \
 			save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
 			source_all_bashrcs ebuild_main \
 			ebuild_phase ebuild_phase_with_hooks \

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to