self.digraph.addnode(jbigkey, myparent,
priority=priority)
+ if mytype != "installed":
+ # Allow this package to satisfy old-style virtuals in case it
+ # doesn't already. Any pre-existing providers will be preferred
+ # over this one.
+ try:
+ pkgsettings.setinst(mykey, metadata)
+ # For consistency, also update the global virtuals.
+ settings = self.roots[myroot].settings
+ settings.unlock()
+ settings.setinst(mykey, metadata)
+ settings.lock()
+ except portage.exception.InvalidDependString, e:
+ show_invalid_depstring_notice(jbigkey, metadata["PROVIDE"], str(e))
+ del e
+ return 0
+
if arg:
self._set_nodes.add(jbigkey)
self.userVirtuals = {}
# Virtual negatives from user specifications.
self.negVirtuals = {}
+ # Virtuals added by the depgraph via self.setinst().
+ self._depgraphVirtuals = {}
self.user_profile_dir = None
self.local_config = local_config
self.treeVirtuals = copy.deepcopy(clone.treeVirtuals)
self.userVirtuals = copy.deepcopy(clone.userVirtuals)
self.negVirtuals = copy.deepcopy(clone.negVirtuals)
+ self._depgraphVirtuals = copy.deepcopy(clone._depgraphVirtuals)
self.use_defs = copy.deepcopy(clone.use_defs)
self.usemask = copy.deepcopy(clone.usemask)
if len(self.virtuals) == 0:
self.getvirtuals()
# Grab the virtuals this package provides and add them into the tree virtuals.
- provides = mydbapi.aux_get(mycpv, ["PROVIDE"])[0]
+ if isinstance(mydbapi, dict):
+ provides = mydbapi["PROVIDE"]
+ else:
+ provides = mydbapi.aux_get(mycpv, ["PROVIDE"])[0]
if not provides:
return
if isinstance(mydbapi, portdbapi):
self.setcpv(mycpv, mydb=mydbapi)
myuse = self["USE"]
+ elif isinstance(mydbapi, dict):
+ myuse = mydbapi["USE"]
else:
myuse = mydbapi.aux_get(mycpv, ["USE"])[0]
virts = flatten(portage.dep.use_reduce(portage.dep.paren_reduce(provides), uselist=myuse.split()))
cp = dep_getkey(mycpv)
for virt in virts:
virt = dep_getkey(virt)
- providers = self.treeVirtuals.get(virt)
+ providers = self._depgraphVirtuals.get(virt)
if providers is None:
providers = []
- self.treeVirtuals[virt] = providers
+ self._depgraphVirtuals[virt] = providers
if cp not in providers:
providers.append(cp)
modified = True
ptVirtuals[virt].append(cp)
virtuals = stack_dictlist([ptVirtuals, self.treeVirtuals,
- self.dirVirtuals])
+ self.dirVirtuals, self._depgraphVirtuals])
return virtuals
def __delitem__(self,mykey):