summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-08-11 19:46:59 +0000
committerZac Medico <zmedico@gentoo.org>2006-08-11 19:46:59 +0000
commit5c2ed852baee42542aa7bd5faa0a1e647f7f2812 (patch)
tree13d5b27397f3bf59138b6011399ac36533446215
parent1e05ec1d75be4bbdacf52ce22ad70c7fda75c338 (diff)
downloadportage-5c2ed852baee42542aa7bd5faa0a1e647f7f2812.tar.gz
portage-5c2ed852baee42542aa7bd5faa0a1e647f7f2812.tar.bz2
portage-5c2ed852baee42542aa7bd5faa0a1e647f7f2812.zip
Add support for use.force and package.use.force in profiles.
svn path=/main/trunk/; revision=4214
-rwxr-xr-xbin/emerge2
-rw-r--r--pym/portage.py30
2 files changed, 32 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index 184b354a3..4a0cd5511 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1461,6 +1461,8 @@ class depgraph:
cur_iuse = []
forced_flags = set()
+ forced_flags.update(pkgsettings.useforce)
+ forced_flags.update(pkgsettings.puseforce)
forced_flags.update(pkgsettings.usemask)
forced_flags.update(pkgsettings.pusemask)
diff --git a/pym/portage.py b/pym/portage.py
index 0e30cc939..80f14b8f8 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -765,6 +765,7 @@ class config:
self.locked = 0
self.mycpv = None
+ self.puseforce = []
self.puse = []
self.pusemask = []
self.modifiedkeys = []
@@ -805,6 +806,9 @@ class config:
self.usemask = copy.deepcopy(clone.usemask)
self.pusemaskdict = copy.deepcopy(clone.pusemaskdict)
self.pusemask = copy.deepcopy(clone.pusemask)
+ self.useforce = copy.deepcopy(clone.useforce)
+ self.puseforcedict = copy.deepcopy(clone.puseforcedict)
+ self.puseforce = copy.deepcopy(clone.puseforce)
self.puse = copy.deepcopy(clone.puse)
self.mycpv = copy.deepcopy(clone.mycpv)
@@ -954,6 +958,21 @@ class config:
self.pusemaskdict[cp][k] = v
del rawpusemask
+ self.useforce = stack_lists(
+ [grabfile(os.path.join(x, "use.force")) \
+ for x in self.profiles], incremental=True)
+
+ self.puseforcedict = {}
+ rawpuseforce = [grabdict_package(
+ os.path.join(x, "package.use.force")) \
+ for x in self.profiles]
+ rawpuseforce = stack_dictlist(rawpuseforce, incremental=True)
+ for k, v in rawpuseforce.iteritems():
+ cp = dep_getkey(k)
+ self.puseforcedict.setdefault(cp, {})
+ self.puseforcedict[cp][k] = v
+ del rawpuseforce
+
try:
mygcfg_dlists = [getconfig(os.path.join(x, "make.globals")) \
for x in self.profiles + [os.path.join(config_root, "etc")]]
@@ -1337,6 +1356,7 @@ class config:
self.mycpv = None
self.puse = ""
self.pusemask = []
+ self.puseforce = []
self.configdict["pkg"].clear()
self.regenerate(use_cache=use_cache)
@@ -1397,6 +1417,12 @@ class config:
self.pusemaskdict[cp].keys())
if pusemaskkey:
self.pusemask = set(self.pusemaskdict[cp][pusemaskkey])
+ self.puseforce = []
+ if cp in self.puseforcedict:
+ puseforcekey = best_match_to_list(self.mycpv,
+ self.puseforcedict[cp].keys())
+ if puseforcekey:
+ self.puseforce = self.puseforcedict[cp][puseforcekey][:]
self.configdict["pkg"]["PKGUSE"] = self.puse[:] # For saving to PUSE file
self.configdict["pkg"]["USE"] = self.puse[:] # this gets appended to USE
# CATEGORY is essential for doebuild calls
@@ -1559,6 +1585,10 @@ class config:
if x not in myflags:
myflags.append(x)
+ myflags = set(myflags)
+ myflags.update(self.useforce)
+ myflags.update(self.puseforce)
+
usesplit = [ x for x in myflags if \
x not in self.usemask and x not in self.pusemask ]
usesplit.sort()