From 7213586e1bdfbab66ddb21284eddbd9b51c28cb1 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 1 Jan 2013 15:23:46 -0800 Subject: repoman: handle EAPI 5 usex, bug #449678 --- pym/repoman/checks.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'pym/repoman/checks.py') 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', -- cgit v1.2.3-1-g7c22