From 1f2d8bc9960221a9a04df57d21a54c868bb95b05 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 9 Jun 2011 06:13:32 -0700 Subject: getmaskingreason: EAPI metadata safety Return early since otherwise we might produce invalid results given that the EAPI is not supported. --- pym/portage/package/ebuild/getmaskingreason.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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: -- cgit v1.2.3-1-g7c22