diff options
-rwxr-xr-x | bin/emerge | 8 | ||||
-rw-r--r-- | pym/portage.py | 23 |
2 files changed, 27 insertions, 4 deletions
diff --git a/bin/emerge b/bin/emerge index ee5669b0b..29710f11f 100755 --- a/bin/emerge +++ b/bin/emerge @@ -1363,12 +1363,12 @@ class depgraph: bindb = self.trees[myroot]["bintree"].dbapi vartree = self.trees[myroot]["vartree"] pkgsettings = self.pkgsettings[myroot] + pkgsettings.setcpv(pkg_key) if pkg_key not in self.applied_useflags: if "binary" == pkg_type: self.applied_useflags[pkg_key] = bindb.aux_get( pkg_key, ["USE"])[0].split() elif "ebuild" == pkg_type: - pkgsettings.setcpv(pkg_key) self.applied_useflags[pkg_key] = pkgsettings["USE"].split() fetch=" " @@ -1448,7 +1448,8 @@ class depgraph: cur_iuse = portage.unique_array(cur_iuse) cur_iuse = [flag for flag in cur_iuse - if flag not in pkgsettings.usemask] + if flag not in pkgsettings.usemask \ + and flag not in pkgsettings.pusemask] cur_iuse.sort() cur_use = self.applied_useflags[x[2]] cur_use = [flag for flag in cur_use if flag in cur_iuse] @@ -1470,7 +1471,8 @@ class depgraph: old_use = [] is_new = True old_iuse = [flag for flag in old_iuse - if flag not in pkgsettings.usemask] + if flag not in pkgsettings.usemask \ + and flag not in pkgsettings.pusemask] old_use = [flag for flag in old_use if flag in old_iuse] use_expand = pkgsettings["USE_EXPAND"].lower().split() diff --git a/pym/portage.py b/pym/portage.py index a348cdd4f..c3818310b 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -766,6 +766,7 @@ class config: self.locked = 0 self.mycpv = None self.puse = [] + self.pusemask = [] self.modifiedkeys = [] self.uvlist = [] @@ -802,6 +803,8 @@ class config: self.use_defs = copy.deepcopy(clone.use_defs) self.usemask = copy.deepcopy(clone.usemask) + self.pusemaskdict = copy.deepcopy(clone.pusemaskdict) + self.pusemask = copy.deepcopy(clone.pusemask) self.configlist = copy.deepcopy(clone.configlist) self.lookuplist = self.configlist[:] @@ -938,6 +941,17 @@ class config: self.use_defs = stack_dictlist(use_defs_lists, incremental=True) del use_defs_lists + self.pusemaskdict = {} + rawpusemask = [grabdict_package( + os.path.join(x, "package.use.mask")) \ + for x in self.profiles] + rawpusemask = stack_dictlist(rawpusemask, incremental=True) + for k, v in rawpusemask.iteritems(): + cp = dep_getkey(k) + self.pusemaskdict.setdefault(cp, {}) + self.pusemaskdict[cp][k] = v + del rawpusemask + try: mygcfg_dlists = [getconfig(os.path.join(x, "make.globals")) \ for x in self.profiles + [os.path.join(config_root, "etc")]] @@ -1317,6 +1331,7 @@ class config: if not keeping_pkg: self.mycpv = None self.puse = "" + self.pusemask = [] self.configdict["pkg"].clear() self.regenerate(use_cache=use_cache) @@ -1371,6 +1386,12 @@ class config: self.pusekey = best_match_to_list(self.mycpv, self.pusedict[cp].keys()) if self.pusekey: self.puse = " ".join(self.pusedict[cp][self.pusekey]) + self.pusemask = [] + if cp in self.pusemaskdict: + pusemaskkey = best_match_to_list(self.mycpv, + self.pusemaskdict[cp].keys()) + if pusemaskkey: + self.pusemask = set(self.pusemaskdict[cp][pusemaskkey]) 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 @@ -1510,7 +1531,7 @@ class config: usesplit=[] for x in string.split(self.configlist[-1]["USE"]): - if x not in self.usemask: + if x not in self.usemask and x not in self.pusemask: usesplit.append(x) # Pre-Pend ARCH variable to USE settings so '-*' in env doesn't kill arch. |