summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-06-09 06:13:32 -0700
committerZac Medico <zmedico@gentoo.org>2011-06-09 06:13:55 -0700
commit1f2d8bc9960221a9a04df57d21a54c868bb95b05 (patch)
tree5d3c8a44ddd0f552ee62e8a8065a7098db3e2d8d
parent993030fa80fd1dc415d9cab5fb9c05de05690818 (diff)
downloadportage-1f2d8bc9960221a9a04df57d21a54c868bb95b05.tar.gz
portage-1f2d8bc9960221a9a04df57d21a54c868bb95b05.tar.bz2
portage-1f2d8bc9960221a9a04df57d21a54c868bb95b05.zip
getmaskingreason: EAPI metadata safety
Return early since otherwise we might produce invalid results given that the EAPI is not supported.
-rw-r--r--pym/portage/package/ebuild/getmaskingreason.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/pym/portage/package/ebuild/getmaskingreason.py b/pym/portage/package/ebuild/getmaskingreason.py
index f027876d8..f2af6387b 100644
--- a/pym/portage/package/ebuild/getmaskingreason.py
+++ b/pym/portage/package/ebuild/getmaskingreason.py
@@ -47,6 +47,17 @@ def getmaskingreason(mycpv, metadata=None, settings=None,
if myrepo is not None:
myrepo = _gen_valid_repo(metadata["repository"])
+ if metadata is not None and \
+ not portage.eapi_is_supported(metadata["EAPI"]):
+ # Return early since otherwise we might produce invalid
+ # results given that the EAPI is not supported. Also,
+ # metadata is mostly useless in this case since it doesn't
+ # contain essential things like SLOT.
+ if return_location:
+ return (None, None)
+ else:
+ return None
+
# Sometimes we can't access SLOT or repository due to corruption.
pkg = mycpv
if metadata is not None: