summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-23 00:32:07 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-23 00:32:07 +0000
commitea6f9ff838c257fb22a12c686f04b3b69dbbd0fd (patch)
tree492f39412f824f1c240647c61ad9eca6074510b4 /bin
parent8720ca28e13163d3b3fa36573dcd8b4e1da73387 (diff)
downloadportage-ea6f9ff838c257fb22a12c686f04b3b69dbbd0fd.tar.gz
portage-ea6f9ff838c257fb22a12c686f04b3b69dbbd0fd.tar.bz2
portage-ea6f9ff838c257fb22a12c686f04b3b69dbbd0fd.zip
Bug #196652 - Check for useless ABOUT-NLS|COPYING|LICENSE
files in dodoc arguments. (trunk r8236) svn path=/main/branches/2.1.2/; revision=8237
Diffstat (limited to 'bin')
-rwxr-xr-xbin/repoman21
1 files changed, 20 insertions, 1 deletions
diff --git a/bin/repoman b/bin/repoman
index 938f3b6c3..9579903c5 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -817,6 +817,25 @@ class EbuildQuote(object):
break
return errors
+class EbuildUselessDodoc(object):
+ """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):
+ self.contents = 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
+
if mymode == "commit":
retval = ("","")
if isCvs:
@@ -1438,7 +1457,7 @@ for x in scanlist:
finally:
f.close()
del f
- for check in (EbuildQuote, ):
+ for check in (EbuildQuote, EbuildUselessDodoc):
c = check(contents)
errors = c.Run()
for e in errors: