summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2007-10-01 12:28:17 +0000
committerAlec Warner <antarus@gentoo.org>2007-10-01 12:28:17 +0000
commitff40a09812839da695eba0c993a77a8856b902c8 (patch)
tree7c427170e2576d0c04b92bf0b7ffd226ade2668d
parent06c25cd3f55b72d5c92555e4f3f25af83a19466a (diff)
downloadportage-ff40a09812839da695eba0c993a77a8856b902c8.tar.gz
portage-ff40a09812839da695eba0c993a77a8856b902c8.tar.bz2
portage-ff40a09812839da695eba0c993a77a8856b902c8.zip
Apply new checks, minor cleanup
svn path=/main/trunk/; revision=7899
-rwxr-xr-xbin/repoman19
1 files changed, 11 insertions, 8 deletions
diff --git a/bin/repoman b/bin/repoman
index 2d3ea5c66..a3b86e358 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -53,8 +53,8 @@ try:
except ImportError:
from os import path as osp
sys.path.insert(0, osp.join(osp.dirname(osp.dirname(osp.realpath(__file__))), 'pym'))
- from repoman.checks import EbuildWhitespaceCheck, EbuildHeaderCheck, EbuildQuoteCheck, \
- EbuildAssignmentCheck
+ from repoman.checks import EbuildWhitespace, EbuildHeader, EbuildQuote, \
+ EbuildAssignment, EbuildNestedDie
import portage.checksum
import portage.const
@@ -1262,10 +1262,6 @@ for x in scanlist:
stats["usage.obsolete"] += 1
fails["usage.obsolete"].append("%s/%s.ebuild: not migrated to modular X" % (x, y))
- # this check needs work, it won't catch (\ndie)
- if not os.system("egrep '^[^#]*\([^)]*\<die\>' "+checkdir+"/"+y+".ebuild >/dev/null 2>&1"):
- stats["ebuild.nesteddie"]=stats["ebuild.nesteddie"]+1
- fails["ebuild.nesteddie"].append(x+"/"+y+".ebuild")
# uselist checks - global
myuse = []
default_use = []
@@ -1340,7 +1336,7 @@ for x in scanlist:
path = checkdir + '/' + y + '.ebuild'
myear = time.gmtime(os.stat(path)[ST_MTIME])[0]
contents = StringIO.StringIO(open(path, 'rb').read())
- for check in (EbuildWhitespaceCheck, EbuildQuoteCheck, EbuildAssignmentCheck):
+ for check in (EbuildWhitespace, EbuildQuote, EbuildAssignment):
c = check(contents)
errors = c.Run()
for e in errors:
@@ -1348,11 +1344,18 @@ for x in scanlist:
fails[c.repoman_check_name].append(x + '/' + y + '.ebuild: %s' % e[1] % e[0])
contents.seek(0) # move fp to the beginning of the StringIO Object
del check
- check = EbuildHeaderCheck(contents, str(myear))
+ check = EbuildHeader(contents, str(myear))
errors = check.Run()
for e in errors:
stats[check.repoman_check_name] += 1
fails[check.repoman_check_name].append(x + '/' + y + '.ebuild: %s' % e[1] % e[0])
+ contents.seek(0)
+ del check
+ check = EbuildNestedDie(contents)
+ errors = check.Run()
+ for e in errors:
+ stats[check.repoman_check_name] += 1
+ fails[check.repoman_check_name].append(x + '/' + y + '.ebuild: %s' % e)
del check, errors, path, contents, myear
if "--force" in myoptions: