summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-07 21:55:35 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-07 21:55:35 +0000
commit376cbb47bfa3e85ee72be801b731cd504dd83ed1 (patch)
treeb93b33265b7f655ef0e715e887dd8e96706d0be9
parent83b5250b89ab9691d1834a313f38f517d9eacb82 (diff)
downloadportage-376cbb47bfa3e85ee72be801b731cd504dd83ed1.tar.gz
portage-376cbb47bfa3e85ee72be801b731cd504dd83ed1.tar.bz2
portage-376cbb47bfa3e85ee72be801b731cd504dd83ed1.zip
Allow config.setcpv() to take a dictionary of package metadata
in place of a dbapi instance so that extra cache pulls can be avoided. svn path=/main/trunk/; revision=7998
-rw-r--r--pym/portage/__init__.py6
-rw-r--r--pym/portage/dbapi/porttree.py4
2 files changed, 7 insertions, 3 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 84548e3ab..788ff728b 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -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():
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index f794f23d9..eeda30f83 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -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):