summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-07-01 05:03:16 +0000
committerZac Medico <zmedico@gentoo.org>2006-07-01 05:03:16 +0000
commit44b26b547597b8ef96467fc2350599ff713eab7a (patch)
tree3682a7f44a3a29f466a27253349f3a7c371a082a
parent75e1148c91c8b54ff4b8b011ff81a328a609b9f1 (diff)
downloadportage-44b26b547597b8ef96467fc2350599ff713eab7a.tar.gz
portage-44b26b547597b8ef96467fc2350599ff713eab7a.tar.bz2
portage-44b26b547597b8ef96467fc2350599ff713eab7a.zip
Allow portage.getmaskingreason() to operate without global variables.
svn path=/main/trunk/; revision=3727
-rwxr-xr-xbin/emerge3
-rw-r--r--pym/portage.py7
2 files changed, 7 insertions, 3 deletions
diff --git a/bin/emerge b/bin/emerge
index 32a72527c..98ded201b 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1058,7 +1058,8 @@ class depgraph:
mreasons = portage.getmaskingstatus(p,
settings=self.settings, portdb=self.portdb)
print "- "+p+" (masked by: "+string.join(mreasons, ", ")+")"
- comment = portage.getmaskingreason(p)
+ comment = portage.getmaskingreason(p,
+ settings=self.settings, portdb=self.portdb)
if comment and comment != oldcomment:
print comment
oldcomment = comment
diff --git a/pym/portage.py b/pym/portage.py
index c4d0e4a50..839117a65 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3633,9 +3633,12 @@ def cpv_expand(mycpv, mydb=None, use_cache=1, settings=None):
else:
return mykey
-def getmaskingreason(mycpv):
+def getmaskingreason(mycpv, settings=None, portdb=None):
from portage_util import grablines
- global portdb, settings
+ 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)