summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-17 04:31:10 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-17 04:31:10 +0000
commitc2a9bb3d06d32472d4bbadc15a397c5746645372 (patch)
tree10b7a2c7a4d19a305b9089454a72f6b52dcc2066
parent944e9809ca7e80fa760f52eee53f562245da5804 (diff)
downloadportage-c2a9bb3d06d32472d4bbadc15a397c5746645372.tar.gz
portage-c2a9bb3d06d32472d4bbadc15a397c5746645372.tar.bz2
portage-c2a9bb3d06d32472d4bbadc15a397c5746645372.zip
Merge package.use and USE from make.defaults together at each level of the profile stack. This is analogous to how use.mask and package.use.mask are planned to be merged for bug #151586.
svn path=/main/trunk/; revision=4734
-rw-r--r--cnf/make.globals2
-rw-r--r--pym/portage.py55
2 files changed, 32 insertions, 25 deletions
diff --git a/cnf/make.globals b/cnf/make.globals
index 96f3a5b36..d10aaf8e0 100644
--- a/cnf/make.globals
+++ b/cnf/make.globals
@@ -61,7 +61,7 @@ CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d"
# Disable auto-use
-USE_ORDER="env:pkg:conf:pkgprofile:defaults:pkginternal"
+USE_ORDER="env:pkg:conf:defaults:pkginternal"
# Default ownership of installed files.
PORTAGE_INST_UID="0"
diff --git a/pym/portage.py b/pym/portage.py
index f8474cb1b..db41a2cb7 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -898,6 +898,7 @@ class config:
self.puseforcedict = copy.deepcopy(clone.puseforcedict)
self.puseforce = copy.deepcopy(clone.puseforce)
self.puse = copy.deepcopy(clone.puse)
+ self.make_defaults_use = copy.deepcopy(clone.make_defaults_use)
self.pkgprofileuse = copy.deepcopy(clone.pkgprofileuse)
self.mycpv = copy.deepcopy(clone.mycpv)
@@ -909,12 +910,11 @@ class config:
"pkginternal": self.configlist[1],
"globals": self.configlist[2],
"defaults": self.configlist[3],
- "pkgprofile": self.configlist[4],
- "conf": self.configlist[5],
- "pkg": self.configlist[6],
- "auto": self.configlist[7],
- "backupenv": self.configlist[8],
- "env": self.configlist[9] }
+ "conf": self.configlist[4],
+ "pkg": self.configlist[5],
+ "auto": self.configlist[6],
+ "backupenv": self.configlist[7],
+ "env": self.configlist[8] }
self.profiles = copy.deepcopy(clone.profiles)
self.backupenv = self.configdict["backupenv"]
self.pusedict = copy.deepcopy(clone.pusedict)
@@ -1049,15 +1049,15 @@ class config:
self.pusemaskdict[cp][k] = v
del rawpusemask
- self.pkgprofileuse = {}
+ self.pkgprofileuse = []
rawprofileuse = [grabdict_package(
os.path.join(x, "package.use"), juststrings=True) \
for x in self.profiles]
- rawprofileuse = stack_dicts(rawprofileuse, incremental=True)
- for k, v in rawprofileuse.iteritems():
- cp = dep_getkey(k)
- self.pkgprofileuse.setdefault(cp, {})
- self.pkgprofileuse[cp][k] = v
+ for i in xrange(len(self.profiles)):
+ cpdict = {}
+ for k, v in rawprofileuse[i].iteritems():
+ cpdict.setdefault(dep_getkey(k), {})[k] = v
+ self.pkgprofileuse.append(cpdict)
del rawprofileuse
self.useforce = stack_lists(
@@ -1092,10 +1092,16 @@ class config:
self.configlist.append(self.mygcfg)
self.configdict["globals"]=self.configlist[-1]
+ self.make_defaults_use = []
self.mygcfg = {}
if self.profiles:
try:
mygcfg_dlists = [getconfig(os.path.join(x, "make.defaults")) for x in self.profiles]
+ for cfg in mygcfg_dlists:
+ if cfg:
+ self.make_defaults_use.append(cfg.get("USE", ""))
+ else:
+ self.make_defaults_use.append("")
self.mygcfg = stack_dicts(mygcfg_dlists, incrementals=portage_const.INCREMENTALS, ignore_none=1)
#self.mygcfg = grab_stacked("make.defaults", self.profiles, getconfig)
if self.mygcfg is None:
@@ -1114,9 +1120,6 @@ class config:
self.configlist.append(self.mygcfg)
self.configdict["defaults"]=self.configlist[-1]
- self.configlist.append({})
- self.configdict["pkgprofile"] = self.configlist[-1]
-
try:
self.mygcfg = getconfig(
os.path.join(config_root, MAKE_CONF_FILE.lstrip(os.path.sep)),
@@ -1298,7 +1301,7 @@ class config:
# reasonable defaults; this is important as without USE_ORDER,
# USE will always be "" (nothing set)!
if "USE_ORDER" not in self:
- self.backupenv["USE_ORDER"] = "env:pkg:conf:pkgprofile:defaults:pkginternal"
+ self.backupenv["USE_ORDER"] = "env:pkg:conf:defaults:pkginternal"
self["PORTAGE_GID"] = str(portage_gid)
self.backup_changes("PORTAGE_GID")
@@ -1462,7 +1465,8 @@ class config:
self.puseforce = []
self.configdict["pkg"].clear()
self.configdict["pkginternal"].clear()
- self.configdict["pkgprofile"].clear()
+ self.configdict["defaults"]["USE"] = \
+ " ".join(self.make_defaults_use)
self.regenerate(use_cache=use_cache)
def load_infodir(self,infodir):
@@ -1518,13 +1522,16 @@ class config:
for x in mydb.aux_get(mycpv, ["IUSE"])[0].split() \
if x.startswith("+")])
self.configdict["pkginternal"]["USE"] = pkginternaluse
- pkgprofileuse = ""
- if cp in self.pkgprofileuse:
- best_match = best_match_to_list(
- self.mycpv, self.pkgprofileuse[cp].keys())
- if best_match:
- pkgprofileuse = self.pkgprofileuse[cp][best_match]
- self.configdict["pkgprofile"]["USE"] = pkgprofileuse
+ defaults = []
+ for i in xrange(len(self.profiles)):
+ profile_use = self.make_defaults_use[i]
+ cpdict = self.pkgprofileuse[i].get(cp, None)
+ if cpdict:
+ best_match = best_match_to_list(self.mycpv, cpdict.keys())
+ if best_match:
+ profile_use += " " + cpdict[best_match]
+ defaults.append(profile_use)
+ self.configdict["defaults"]["USE"] = " ".join(defaults)
self.puse = ""
if self.pusedict.has_key(cp):
self.pusekey = best_match_to_list(self.mycpv, self.pusedict[cp].keys())