repoman: disallow EMERGE_FROM in EAPI 4
authorZac Medico <zmedico@gentoo.org>
Tue, 31 May 2011 22:22:02 +0000 (15:22 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 31 May 2011 22:22:02 +0000 (15:22 -0700)
We already have the Eapi4GoneVars check for AA and KV which were
removed in EAPI 4, so we can re-use it to disallow EMERGE_FROM.
This will fix bug #368865.

pym/repoman/checks.py

index bc25cd58e4607d342974ad997d2eb8ced54d067a..c9ada5fbbcc30e143fffa8e222ab9445f301c1e5 100644 (file)
@@ -619,10 +619,11 @@ class Eapi4IncompatibleFuncs(LineCheck):
 class Eapi4GoneVars(LineCheck):
        repoman_check_name = 'EAPI.incompatible'
        ignore_line = re.compile(r'(^\s*#)')
-       undefined_vars_re = re.compile(r'.*\$(\{(AA|KV)\}|(AA|KV))')
+       undefined_vars_re = re.compile(r'.*\$(\{(AA|KV|EMERGE_FROM)\}|(AA|KV|EMERGE_FROM))')
 
        def check_eapi(self, eapi):
-               return not eapi_exports_AA(eapi) or not eapi_exports_KV(eapi)
+               # AA, KV, and EMERGE_FROM should not be referenced in EAPI 4 or later.
+               return not eapi_exports_AA(eapi)
 
        def check(self, num, line):
                m = self.undefined_vars_re.match(line)