Index: bin/ebuild.sh =================================================================== RCS file: /var/cvsroot/gentoo-src/portage/bin/ebuild.sh,v retrieving revision 1.201.2.35 diff -u -r1.201.2.35 ebuild.sh --- bin/ebuild.sh 31 May 2005 22:44:50 -0000 1.201.2.35 +++ bin/ebuild.sh 11 Jun 2005 21:06:46 -0000 @@ -130,7 +130,16 @@ # Make sure we have this USE flag in IUSE if ! hasq "${u}" ${IUSE} ${E_IUSE} && ! hasq "${u}" ${PORTAGE_ARCHLIST} selinux; then - echo "QA Notice: USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}" >&2 + local prefix expanded=0 + # USE_EXPANDed USE flags are not in IUSE + for prefix in ${USE_EXPAND_PREFIX}; do + if [ "${u:0:${#prefix}}" == "${prefix}" ]; then + expanded=1 + fi + done + if [ ${expanded} -eq 0 ]; then + echo "QA Notice: USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}" >&2 + fi fi for x in ${USE}; do Index: pym/portage.py =================================================================== RCS file: /var/cvsroot/gentoo-src/portage/pym/portage.py,v retrieving revision 1.524.2.76 diff -u -r1.524.2.76 portage.py --- pym/portage.py 29 May 2005 12:40:08 -0000 1.524.2.76 +++ pym/portage.py 11 Jun 2005 21:06:55 -0000 @@ -1051,6 +1051,11 @@ self.pusedict = {} self.pkeywordsdict = {} self.punmaskdict = {} + # Remove USE_EXPANDed settings from local settings + for use_expand in self["USE_EXPAND"].split(): + for config in ["conf", "env", "backupenv"]: + if self.configdict[config].has_key(use_expand): + del self.configdict[config][use_expand] else: locations = [self["PORTDIR"] + "/profiles", USER_CONFIG_PATH] for ov in self["PORTDIR_OVERLAY"].split(): @@ -1382,6 +1387,7 @@ #cache split-up USE var in a global usesplit=[] + expandprefix=[] for x in string.split(self.configlist[-1]["USE"]): if x not in self.usemask: @@ -1389,6 +1395,7 @@ if self.has_key("USE_EXPAND"): for var in string.split(self["USE_EXPAND"]): + expandprefix.append(var.lower()+"_") if self.has_key(var): for x in string.split(self[var]): mystr = string.lower(var)+"_"+x @@ -1402,6 +1409,7 @@ usesplit.insert(0,self.configdict["defaults"]["ARCH"]) self.configlist[-1]["USE"]=string.join(usesplit," ") + self.configlist[-1]["USE_EXPAND_PREFIX"]=string.join(expandprefix," ") self.already_in_regenerate = 0 @@ -3760,7 +3768,13 @@ while mysettings["ARCH"] in mymasks: del mymasks[mymasks.index(mysettings["ARCH"])] - mysplit = portage_dep.use_reduce(mysplit,uselist=myusesplit,masklist=mymasks,matchall=(use=="all"),excludeall=[mysettings["ARCH"]]) + myexcludes = [mysettings["ARCH"]] + use_expands = mysettings["USE_EXPAND"].split() + for use_expand in use_expands: + if mysettings.has_key(use_expand): + for value in mysettings[use_expand].split(): + myexcludes.append(use_expand.lower() + "_" + value) + mysplit = portage_dep.use_reduce(mysplit,uselist=myusesplit,masklist=mymasks,matchall=(use=="all"),excludeall=myexcludes,use_expands=use_expands) else: mysplit = portage_dep.use_reduce(mysplit,uselist=myusesplit,matchall=(use=="all")) Index: pym/portage_dep.py =================================================================== RCS file: /var/cvsroot/gentoo-src/portage/pym/portage_dep.py,v retrieving revision 1.15.2.3 diff -u -r1.15.2.3 portage_dep.py --- pym/portage_dep.py 2 Apr 2005 14:07:59 -0000 1.15.2.3 +++ pym/portage_dep.py 11 Jun 2005 21:06:55 -0000 @@ -56,7 +56,7 @@ mylist = mylist + [subsec] return mylist -def use_reduce(deparray, uselist=[], masklist=[], matchall=0, excludeall=[]): +def use_reduce(deparray, uselist=[], masklist=[], matchall=0, excludeall=[], use_expands=[]): """Takes a paren_reduce'd array and reduces the use? conditionals out leaving an array with subarrays """ @@ -83,7 +83,7 @@ head = mydeparray.pop(0) if type(head) == types.ListType: - rlist = rlist + [use_reduce(head, uselist, masklist, matchall, excludeall)] + rlist = rlist + [use_reduce(head, uselist, masklist, matchall, excludeall, use_expands)] else: if head[-1] == "?": # Use reduce next group on fail. @@ -110,6 +110,12 @@ ismatch = True for head in newdeparray[:-1]: head = head[:-1] + for use_expand in use_expands: + if head.startswith(use_expand.lower() + "_") and head not in excludeall: + # We have a USE_EXPANDed flag that is not excluded + ismatch = False + break + if head[0] == "!": head = head[1:] if not matchall and head in uselist or head in excludeall: @@ -126,7 +132,7 @@ if ismatch: target = newdeparray[-1] if isinstance(target, list): - rlist += [use_reduce(target, uselist, masklist, matchall, excludeall)] + rlist += [use_reduce(target, uselist, masklist, matchall, excludeall, use_expands)] else: rlist += [target]