From 376cbb47bfa3e85ee72be801b731cd504dd83ed1 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 7 Oct 2007 21:55:35 +0000 Subject: 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 --- pym/portage/__init__.py | 6 +++++- pym/portage/dbapi/porttree.py | 4 ++-- 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): -- cgit v1.2.3-1-g7c22