From: Zac Medico Date: Sun, 21 Oct 2007 21:23:36 +0000 (-0000) Subject: Always pass package metadata into depgraph.create() so X-Git-Tag: v2.2_pre1~562 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3738aecd6d2cc293baafcb596dee5e0e6aacd773;p=portage.git Always pass package metadata into depgraph.create() so it doesn't have to get it itself. svn path=/main/trunk/; revision=8220 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 91d4ed98a..d76a244c4 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1249,17 +1249,6 @@ class depgraph(object): portdb = self.trees[myroot]["porttree"].dbapi bindb = self.trees[myroot]["bintree"].dbapi pkgsettings = self.pkgsettings[myroot] - - # if the package is already on the system, we add a "nomerge" - # directive, otherwise we add a "merge" directive. - - mydbapi = self.trees[myroot][self.pkg_tree_map[mytype]].dbapi - if metadata is None: - metadata = dict(izip(self._mydbapi_keys, - mydbapi.aux_get(mykey, self._mydbapi_keys))) - if mytype == "ebuild": - pkgsettings.setcpv(mykey, mydb=portdb) - metadata["USE"] = pkgsettings["USE"] myuse = metadata["USE"].split() if not arg and myroot == self.target_root: @@ -1491,8 +1480,10 @@ class depgraph(object): os.path.realpath(self.trees[myroot]["bintree"].getname(mykey)): print colorize("BAD", "\n*** You need to adjust PKGDIR to emerge this package.\n") return 0, myfavorites + metadata = dict(izip(self._mydbapi_keys, + bindb.aux_get(mykey, self._mydbapi_keys))) pkg = Package(type_name="binary", root=myroot, - cpv=mykey, built=True) + cpv=mykey, built=True, metadata=metadata) if not self.create(pkg, addme=addme, arg=x): return 0, myfavorites arg_atoms.append((x, "="+mykey)) @@ -1526,8 +1517,12 @@ class depgraph(object): else: raise portage.exception.PackageNotFound( "%s is not in a valid portage tree hierarchy or does not exist" % x) + metadata = dict(izip(self._mydbapi_keys, + portdb.aux_get(mykey, self._mydbapi_keys))) + pkgsettings.setcpv(mykey, mydb=metadata) + metadata["USE"] = pkgsettings["USE"] pkg = Package(type_name="ebuild", root=myroot, - cpv=mykey) + cpv=mykey, metadata=metadata) if not self.create(pkg, addme=addme, arg=x): return 0, myfavorites arg_atoms.append((x, "="+mykey))