summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-06 03:29:48 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-06 03:29:48 -0700
commitde0657223812d7768e6b474d6db84d87fa2242ff (patch)
treebb5eea6255dd5803519d235eb4f75e32e78d9d5c
parent854dc8bdbe487469c57a40e73629f06bdbae5adf (diff)
downloadportage-de0657223812d7768e6b474d6db84d87fa2242ff.tar.gz
portage-de0657223812d7768e6b474d6db84d87fa2242ff.tar.bz2
portage-de0657223812d7768e6b474d6db84d87fa2242ff.zip
getmaskingreason: assume myrepo arg is valid
-rw-r--r--pym/portage/package/ebuild/getmaskingreason.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/pym/portage/package/ebuild/getmaskingreason.py b/pym/portage/package/ebuild/getmaskingreason.py
index 4e3833d03..c19066f61 100644
--- a/pym/portage/package/ebuild/getmaskingreason.py
+++ b/pym/portage/package/ebuild/getmaskingreason.py
@@ -16,6 +16,12 @@ from _emerge.Package import Package
def getmaskingreason(mycpv, metadata=None, settings=None,
portdb=None, return_location=False, myrepo=None):
+ """
+ If specified, the myrepo argument is assumed it be valid. This
+ should be a safe assumption since portdbapi methods always
+ return valid repo names and valid "repository" metadata from
+ aux_get.
+ """
if settings is None:
settings = portage.settings
if portdb is None:
@@ -24,9 +30,6 @@ def getmaskingreason(mycpv, metadata=None, settings=None,
if not mysplit:
raise ValueError(_("invalid CPV: %s") % mycpv)
- if myrepo:
- myrepo = _gen_valid_repo(myrepo)
-
if metadata is None:
db_keys = list(portdb._aux_cache_keys)
try:
@@ -36,10 +39,10 @@ def getmaskingreason(mycpv, metadata=None, settings=None,
if not portdb.cpv_exists(mycpv):
raise
else:
- if not myrepo:
+ if myrepo is None:
myrepo = _gen_valid_repo(metadata["repository"])
- elif not myrepo:
+ elif myrepo is None:
myrepo = metadata.get("repository")
if myrepo is not None:
myrepo = _gen_valid_repo(metadata["repository"])