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=" "
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]
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()
self.locked = 0
self.mycpv = None
self.puse = []
+ self.pusemask = []
self.modifiedkeys = []
self.uvlist = []
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[:]
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")]]
if not keeping_pkg:
self.mycpv = None
self.puse = ""
+ self.pusemask = []
self.configdict["pkg"].clear()
self.regenerate(use_cache=use_cache)
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
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.