summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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: