Allow config.setcpv() to take a dictionary of package metadata
authorZac Medico <zmedico@gentoo.org>
Sun, 7 Oct 2007 21:55:35 +0000 (21:55 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 7 Oct 2007 21:55:35 +0000 (21:55 -0000)
in place of a dbapi instance so that extra cache pulls can be
avoided.

svn path=/main/trunk/; revision=7998

pym/portage/__init__.py
pym/portage/dbapi/porttree.py

index 84548e3ab182b3d1a4b38c9613c75bf850849894..788ff728b5781a683cd4092498841a546edf8990 100644 (file)
@@ -1764,7 +1764,11 @@ class config(object):
                pkginternaluse = ""
                iuse = ""
                if mydb:
-                       slot, iuse = mydb.aux_get(self.mycpv, ["SLOT", "IUSE"])
+                       if isinstance(mydb, dict):
+                               slot = mydb["SLOT"]
+                               iuse = mydb["IUSE"]
+                       else:
+                               slot, iuse = mydb.aux_get(self.mycpv, ["SLOT", "IUSE"])
                        cpv_slot = "%s:%s" % (self.mycpv, slot)
                        pkginternaluse = []
                        for x in iuse.split():
index f794f23d9bd7c5912f3856d8492fe939e17ba92a..eeda30f83c3350cb89aca8a571e6134dffa9e014 100644 (file)
@@ -661,7 +661,7 @@ class portdbapi(dbapi):
                if mylist is None:
                        return []
                newlist=[]
-               aux_keys = ["KEYWORDS", "LICENSE", "EAPI", "SLOT"]
+               aux_keys = ["IUSE", "KEYWORDS", "LICENSE", "EAPI", "SLOT"]
                metadata = {}
                for mycpv in mylist:
                        metadata.clear()
@@ -681,7 +681,7 @@ class portdbapi(dbapi):
                                continue
                        metadata["USE"] = ""
                        if "?" in metadata["LICENSE"]:
-                               self.doebuild_settings.setcpv(mycpv, mydb=self)
+                               self.doebuild_settings.setcpv(mycpv, mydb=metadata)
                                metadata["USE"] = self.doebuild_settings.get("USE", "")
                        try:
                                if self.mysettings.getMissingLicenses(mycpv, metadata):