summaryrefslogtreecommitdiffstats
path: root/pym/repoman
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2013-01-01 15:23:46 -0800
committerZac Medico <zmedico@gentoo.org>2013-01-01 15:23:46 -0800
commit7213586e1bdfbab66ddb21284eddbd9b51c28cb1 (patch)
tree9318c4e6442b540629f26d3d860d3452ad5df77e /pym/repoman
parent60b16cdad4392093707873b98ea2adab1e0c642f (diff)
downloadportage-7213586e1bdfbab66ddb21284eddbd9b51c28cb1.tar.gz
portage-7213586e1bdfbab66ddb21284eddbd9b51c28cb1.tar.bz2
portage-7213586e1bdfbab66ddb21284eddbd9b51c28cb1.zip
repoman: handle EAPI 5 usex, bug #449678
Diffstat (limited to 'pym/repoman')
-rw-r--r--pym/repoman/checks.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py
index c6c7ddb2b..80e0d14b9 100644
--- a/pym/repoman/checks.py
+++ b/pym/repoman/checks.py
@@ -480,6 +480,7 @@ class InheritEclass(LineCheck):
self._disabled = any(x in inherited for x in self._exempt_eclasses)
else:
self._disabled = False
+ self._eapi = pkg.eapi
def check(self, num, line):
if not self._inherit:
@@ -488,10 +489,14 @@ class InheritEclass(LineCheck):
if self._disabled or self._ignore_missing:
return
s = self._func_re.search(line)
- if s:
- self._func_call = True
- return '%s.eclass is not inherited, but "%s" found at line: %s' % \
- (self._eclass, s.group(3), '%d')
+ if s is not None:
+ func_name = s.group(3)
+ eapi_func = _eclass_eapi_functions.get(func_name)
+ if eapi_func is None or not eapi_func(self._eapi):
+ self._func_call = True
+ return ('%s.eclass is not inherited, '
+ 'but "%s" found at line: %s') % \
+ (self._eclass, func_name, '%d')
elif not self._func_call:
self._func_call = self._func_re.search(line)
@@ -500,6 +505,10 @@ class InheritEclass(LineCheck):
self.repoman_check_name = 'inherit.unused'
yield 'no function called from %s.eclass; please drop' % self._eclass
+_eclass_eapi_functions = {
+ "usex" : lambda eapi: eapi not in ("0", "1", "2", "3", "4")
+}
+
# eclasses that export ${ECLASS}_src_(compile|configure|install)
_eclass_export_functions = (
'ant-tasks', 'apache-2', 'apache-module', 'aspell-dict',