diff options
-rw-r--r-- | pym/portage/package/ebuild/getmaskingreason.py | 13 |
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"]) |