From 99374c3da3eea930becf2c3c391cb42619bb9bf8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 25 Apr 2006 09:36:57 +0000 Subject: [PATCH] Remove all usage of the portage.groups global variable. svn path=/main/trunk/; revision=3231 --- bin/repoman | 5 +++-- pym/portage.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/bin/repoman b/bin/repoman index 2efbe5e70..9429e7c50 100755 --- a/bin/repoman +++ b/bin/repoman @@ -1006,7 +1006,8 @@ for x in scanlist: fails["KEYWORDS.stupid"].append(x+"/"+y+".ebuild") if "--ignore-arches" in myoptions: - arches=[[repoman_settings["ARCH"], repoman_settings["ARCH"], portage.groups]] + arches = [[repoman_settings["ARCH"], repoman_settings["ARCH"], + repoman_settings.groups]] else: arches=[] for keyword in myaux["KEYWORDS"].split(): @@ -1081,7 +1082,6 @@ for x in scanlist: fails["usage.obsolete"].append("%s/%s.ebuild: not migrated to modular X" % (x, y)) for keyword,arch,groups in arches: - portage.groups=groups if not profiles.has_key(arch): # A missing profile will create an error further down @@ -1097,6 +1097,7 @@ for x in scanlist: else: os.environ["ACCEPT_KEYWORDS"]="-~"+arch dep_settings=portage.config(config_profile_path=profdir, config_incrementals=portage_const.INCREMENTALS) + dep_settings.groups = groups portage.portdb=portage.portdbapi(portdir, dep_settings) portage.db["/"]["porttree"]=portage.portagetree("/",dep_settings.getvirtuals("/")) arch_caches[prof[0]]=[dep_settings, portage.portdb, portage.db["/"]["porttree"]] diff --git a/pym/portage.py b/pym/portage.py index 5433289a0..a302d5238 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -1283,6 +1283,9 @@ class config: self._init_dirs() + # Repoman may modify this attribute as necessary. + self.groups = self["ACCEPT_KEYWORDS"].split() + def _init_dirs(self): """Create tmp, var/tmp and var/lib/portage (relative to $ROOT).""" @@ -3508,7 +3511,7 @@ def getmaskingstatus(mycpv): if not eapi_is_supported(eapi): return ["required EAPI %s, supported EAPI %s" % (eapi, portage_const.EAPI)] mygroups = mygroups.split() - pgroups=groups[:] + pgroups = settings.groups myarch = settings["ARCH"] pkgdict = settings.pkeywordsdict @@ -5121,7 +5124,7 @@ class portdbapi(dbapi): def gvisible(self,mylist): "strip out group-masked (not in current group) entries" - global db, groups + global db if mylist is None: return [] newlist=[] @@ -5143,7 +5146,8 @@ class portdbapi(dbapi): #print "!!! No KEYWORDS for "+str(mycpv)+" -- Untested Status" continue mygroups=keys.split() - pgroups=groups[:] + # Repoman may modify this attribute as necessary. + pgroups = self.mysettings.groups match=0 cp = dep_getkey(mycpv) if pkgdict.has_key(cp): @@ -6857,7 +6861,7 @@ thirdpartymirrors = settings.thirdpartymirrors() # COMPATABILITY -- This shouldn't be used. pkglines = settings.packages -groups = settings["ACCEPT_KEYWORDS"].split() +groups = settings["ACCEPT_KEYWORDS"].split() # DEPRECATED (no longer used) archlist = settings.archlist() # Clear the cache -- 2.26.2