From 75e1148c91c8b54ff4b8b011ff81a328a609b9f1 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 1 Jul 2006 04:43:47 +0000 Subject: [PATCH] Allow portage.getmaskingstatus() to operate without global variables. svn path=/main/trunk/; revision=3726 --- bin/emerge | 3 ++- pym/portage.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/emerge b/bin/emerge index 4e1c37bea..32a72527c 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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: diff --git a/pym/portage.py b/pym/portage.py index 13c89ddf5..c4d0e4a50 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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) -- 2.26.2