From: Zac Medico Date: Sun, 22 Aug 2010 20:08:04 +0000 (-0700) Subject: Make InheritDeprecated detect indirect inherits of deprecated eclasses, X-Git-Tag: v2.2_rc68~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=93ceaa213a10df814de8e893f4312dc43e2047c4;p=portage.git Make InheritDeprecated detect indirect inherits of deprecated eclasses, and indicate the indirect nature in the error message. --- diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index 41235c5fa..732559958 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -361,7 +361,7 @@ class ImplicitRuntimeDeps(LineCheck): yield 'RDEPEND is not explicitly assigned' class InheritDeprecated(LineCheck): - """Check if ebuild directly inherits a deprecated eclass""" + """Check if ebuild directly or indirectly inherits a deprecated eclass.""" repoman_check_name = 'inherit.deprecated' @@ -379,6 +379,8 @@ class InheritDeprecated(LineCheck): def new(self, pkg): self._errors = [] + self._indirect_deprecated = set(eclass for eclass in \ + self.deprecated_classes if eclass in pkg.inherited) def check(self, num, line): @@ -393,13 +395,13 @@ class InheritDeprecated(LineCheck): return for eclass in direct_inherits: - replacement = self.deprecated_classes.get(eclass) - if replacement is None: - pass - elif replacement is False: + replacement = self.deprecated_classes[eclass] + if replacement is False: + self._indirect_deprecated.discard(eclass) self._errors.append("please migrate from " + \ "'%s' (no replacement) on line: %d" % (eclass, num + 1)) else: + self._indirect_deprecated.discard(eclass) self._errors.append("please migrate from " + \ "'%s' to '%s' on line: %d" % \ (eclass, replacement, num + 1)) @@ -409,6 +411,19 @@ class InheritDeprecated(LineCheck): yield error del self._errors + for eclass in self._indirect_deprecated: + replacement = self.deprecated_classes.get(eclass) + if replacement is None: + pass + elif replacement is False: + yield "please migrate from indirect " + \ + "inherit of '%s' (no replacement)" % (eclass,) + else: + yield "please migrate from indirect " + \ + "inherit of '%s' to '%s'" % \ + (eclass, replacement) + del self._indirect_deprecated + class InheritAutotools(LineCheck): """ Make sure appropriate functions are called in