Remove all usage of the portage.groups global variable.
authorZac Medico <zmedico@gentoo.org>
Tue, 25 Apr 2006 09:36:57 +0000 (09:36 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 25 Apr 2006 09:36:57 +0000 (09:36 -0000)
svn path=/main/trunk/; revision=3231

bin/repoman
pym/portage.py

index 2efbe5e70aa1d9f364fce8cf6ce8698f3e1722c5..9429e7c50689444ce36cfa4daf3052a2886439db 100755 (executable)
@@ -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"]]
index 5433289a057791f466b855e5a3138aae3c93ed0d..a302d5238d87b65172e729e724fabf14077dad40 100644 (file)
@@ -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