Allow portage.getmaskingstatus() to operate without global variables.
authorZac Medico <zmedico@gentoo.org>
Sat, 1 Jul 2006 04:43:47 +0000 (04:43 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 1 Jul 2006 04:43:47 +0000 (04:43 -0000)
svn path=/main/trunk/; revision=3726

bin/emerge
pym/portage.py

index 4e1c37bead785723b66128cd76d453c34618a3c2..32a72527cc61d4b7472f3e040b4d820dcc93cd80 100755 (executable)
@@ -1055,7 +1055,8 @@ class depgraph:
                                                        print "!!! One of the following masked packages is required to complete your request:"
                                                        oldcomment = ""
                                                        for p in alleb:
-                                                               mreasons = portage.getmaskingstatus(p)
+                                                               mreasons = portage.getmaskingstatus(p,
+                                                                       settings=self.settings, portdb=self.portdb)
                                                                print "- "+p+" (masked by: "+string.join(mreasons, ", ")+")"
                                                                comment = portage.getmaskingreason(p)
                                                                if comment and comment != oldcomment:
index 13c89ddf53d427230cfbc688d882ffc6249ee012..c4d0e4a50cd17f8211e031de9134bce849bbf986 100644 (file)
@@ -3676,8 +3676,11 @@ def getmaskingreason(mycpv):
                                        i = i + 1
        return None
 
-def getmaskingstatus(mycpv):
-       global portdb, settings
+def getmaskingstatus(mycpv, settings=None, portdb=None):
+       if settings is None:
+               settings = globals()["settings"]
+       if portdb is None:
+               portdb = globals()["portdb"]
        mysplit = catpkgsplit(mycpv)
        if not mysplit:
                raise ValueError("invalid CPV: %s" % mycpv)