From: Zac Medico Date: Thu, 9 Jun 2011 13:13:32 +0000 (-0700) Subject: getmaskingreason: EAPI metadata safety X-Git-Tag: v2.2.0_alpha39~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1f2d8bc9960221a9a04df57d21a54c868bb95b05;p=portage.git getmaskingreason: EAPI metadata safety Return early since otherwise we might produce invalid results given that the EAPI is not supported. --- 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: