Bug #224271 - Add a 'IUSE is not defined' ebuild.minorsyn warning.
authorZac Medico <zmedico@gentoo.org>
Sat, 7 Jun 2008 09:23:56 +0000 (09:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 7 Jun 2008 09:23:56 +0000 (09:23 -0000)
svn path=/main/trunk/; revision=10589

pym/repoman/checks.py

index 8f9fd1abca329c5090293a270b04dbb8929abc21..0a314518c8d0e87fedef7d08febafa3b5c6232c6 100644 (file)
@@ -217,13 +217,20 @@ _constant_checks = tuple((c() for c in (
        EbuildUselessCdS, EbuildNestedDie,
        EbuildPatches, EbuildQuotedA)))
 
+_iuse_def_re = re.compile(r'^IUSE=.*')
+
 def run_checks(contents, st_mtime):
        checks = list(_constant_checks)
        checks.append(EbuildHeader(st_mtime))
+       iuse_def = None
        for num, line in enumerate(contents):
+               if iuse_def is None:
+                       iuse_def = _iuse_def_re.match(line)
                for lc in checks:
                        ignore = lc.ignore_line
                        if not ignore or not ignore.match(line):
                                e = lc.check(num, line)
                                if e:
                                        yield lc.repoman_check_name, e % (num + 1)
+       if iuse_def is None:
+               yield 'ebuild.minorsyn', 'IUSE is not defined'