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
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 = []
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:
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: