* [gentoo-dev] [RFC] [EAPI=3] Add approprietly prefixed values of IUSE_* variables to IUSE
@ 2009-07-05 2:33 Arfrever Frehtes Taifersar Arahesis
2009-07-05 11:36 ` David Leverton
2009-07-05 14:52 ` Ciaran McCreesh
0 siblings, 2 replies; 4+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2009-07-05 2:33 UTC (permalink / raw
To: Gentoo Development
[-- Attachment #1.1: Type: text/plain, Size: 710 bytes --]
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.
Example:
IUSE="abc"
IUSE_LINGUAS="en fr +la pl ru"
Effective IUSE would be "abc linguas_en linguas_fr +linguas_la linguas_pl linguas_ru".
Currently ebuilds need to manually add such flags to IUSE.
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.
--
Arfrever Frehtes Taifersar Arahesis
[-- Attachment #1.2: portage-IUSE_variables.patch --]
[-- Type: text/x-patch, Size: 2412 bytes --]
Index: bin/ebuild.sh
===================================================================
--- bin/ebuild.sh (revision 13786)
+++ bin/ebuild.sh (working copy)
@@ -1154,6 +1154,22 @@ debug-print-section() {
debug-print "now in section $*"
}
+expand_IUSE() {
+ if ! has "${EAPI:-0}" 0 1 2 ; then
+ local var flag flag_prefix
+ for var in $USE_EXPAND ; do
+ for flag in $(eval echo \$IUSE_$var) ; do
+ flag_prefix=
+ if [[ ${flag:0:1} == [+-] ]] ; then
+ flag_prefix=${flag:0:1}
+ flag=${flag:1}
+ fi
+ IUSE="$IUSE $flag_prefix$(echo $var | LC_ALL=C tr [:upper:] [:lower:])_$flag"
+ done
+ done
+ fi
+}
+
# Sources all eclasses in parameters
declare -ix ECLASS_DEPTH=0
inherit() {
@@ -1240,6 +1256,8 @@ inherit() {
#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}"
@@ -1750,6 +1768,10 @@ _source_ebuild() {
# eclasses, they need to be unset before this process of
# interaction begins.
unset DEPEND RDEPEND PDEPEND IUSE
+ local var
+ for var in $USE_EXPAND ; do
+ unset IUSE_$var
+ done
source "${EBUILD}" || die "error sourcing ebuild"
if [ "${EBUILD_PHASE}" != "depend" ] ; then
@@ -1773,6 +1795,8 @@ _source_ebuild() {
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 13786)
+++ bin/isolated-functions.sh (working copy)
@@ -512,8 +512,8 @@ save_ebuild_env() {
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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [RFC] [EAPI=3] Add approprietly prefixed values of IUSE_* variables to IUSE
2009-07-05 2:33 [gentoo-dev] [RFC] [EAPI=3] Add approprietly prefixed values of IUSE_* variables to IUSE Arfrever Frehtes Taifersar Arahesis
@ 2009-07-05 11:36 ` David Leverton
2009-07-08 3:31 ` Arfrever Frehtes Taifersar Arahesis
2009-07-05 14:52 ` Ciaran McCreesh
1 sibling, 1 reply; 4+ messages in thread
From: David Leverton @ 2009-07-05 11:36 UTC (permalink / raw
To: gentoo-dev
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.
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [RFC] [EAPI=3] Add approprietly prefixed values of IUSE_* variables to IUSE
2009-07-05 2:33 [gentoo-dev] [RFC] [EAPI=3] Add approprietly prefixed values of IUSE_* variables to IUSE Arfrever Frehtes Taifersar Arahesis
2009-07-05 11:36 ` David Leverton
@ 2009-07-05 14:52 ` Ciaran McCreesh
1 sibling, 0 replies; 4+ messages in thread
From: Ciaran McCreesh @ 2009-07-05 14:52 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 923 bytes --]
On Sun, 5 Jul 2009 04:33:54 +0200
Arfrever Frehtes Taifersar Arahesis <Arfrever@gentoo.org> 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.
Aside from the Council's decision not to include anything new in EAPI
3, which appears to be the only thing protecting us from massive
scope creep, and aside from David's comments about whether we even know
USE_EXPAND during metadata generation...
Are you sure that the way you're suggesting is the most elegant way of
doing things? The alternative proposal was:
IUSE="foo bar linguas: en fr"
which, admittedly, requires adding ( ) support to IUSE, but that's also
required by some of the other IUSE-related proposals.
--
Ciaran McCreesh
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [RFC] [EAPI=3] Add approprietly prefixed values of IUSE_* variables to IUSE
2009-07-05 11:36 ` David Leverton
@ 2009-07-08 3:31 ` Arfrever Frehtes Taifersar Arahesis
0 siblings, 0 replies; 4+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2009-07-08 3:31 UTC (permalink / raw
To: Gentoo Development
[-- Attachment #1.1: Type: text/plain, Size: 1000 bytes --]
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
[-- Attachment #1.2: portage-IUSE_variables.patch --]
[-- Type: text/x-patch, Size: 2411 bytes --]
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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-07-08 3:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-05 2:33 [gentoo-dev] [RFC] [EAPI=3] Add approprietly prefixed values of IUSE_* variables to IUSE Arfrever Frehtes Taifersar Arahesis
2009-07-05 11:36 ` David Leverton
2009-07-08 3:31 ` Arfrever Frehtes Taifersar Arahesis
2009-07-05 14:52 ` Ciaran McCreesh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox