From aeded62f174cf81546dce548b89c58d356dd7bb0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 23 Oct 2007 00:27:33 +0000 Subject: Bug #196652 - Check for useless ABOUT-NLS|COPYING|LICENSE files in dodoc arguments. svn path=/main/trunk/; revision=8236 --- pym/repoman/checks.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'pym/repoman') diff --git a/pym/repoman/checks.py b/pym/repoman/checks.py index d956b83f8..93c3222b3 100644 --- a/pym/repoman/checks.py +++ b/pym/repoman/checks.py @@ -224,3 +224,22 @@ class EbuildNestedDie(ContentCheck): if match: errors.append((num + 1, NESTED_DIE_ERROR)) return errors + +class EbuildUselessDodoc(ContentCheck): + """Check ebuild for useless files in dodoc arguments.""" + repoman_check_name = 'ebuild.minorsyn' + uselessdodoc_re = re.compile( + r'^\s*dodoc(\s+|\s+.*\s+)(ABOUT-NLS|COPYING|LICENSE)($|\s)') + + def __init__(self, contents): + ContentCheck.__init__(self, contents) + + def Run(self): + errors = [] + uselessdodoc_re = self.uselessdodoc_re + for num, line in enumerate(self.contents): + match = uselessdodoc_re.match(line) + if match: + errors.append((num + 1, "Useless dodoc '%s'" % \ + (match.group(2), ) + " on line: %d")) + return errors -- cgit v1.2.3-1-g7c22