Warn about WANT_AUTO(CONF|MAKE)=latest settings since they are redundant.
authorZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 03:40:36 +0000 (03:40 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 11 Mar 2009 03:40:36 +0000 (03:40 -0000)
Thanks to Petteri Räty <betelgeuse@g.o> for the initial patch. (trunk r12583)

svn path=/main/branches/2.1.6/; revision=12864

pym/repoman/checks.py

index c9ef91cfc91d9df7a92259d2367e413bbabf2bfa..e89020980a6d85a262bb59c1b7a38ab18a76b17e 100644 (file)
@@ -328,13 +328,25 @@ class DeprecatedBindnowFlags(LineCheck):
        re = re.compile(r'.*\$\(bindnow-flags\)')
        error = errors.DEPRECATED_BINDNOW_FLAGS
 
+class WantAutoDefaultValue(LineCheck):
+       """Check setting WANT_AUTO* to latest (default value)."""
+       repoman_check_name = 'ebuild.minorsyn'
+       _re = re.compile(r'^WANT_AUTO(CONF|MAKE)=(\'|")?latest')
+
+       def check(self, num, line):
+               m = self._re.match(line)
+               if m is not None:
+                       return 'WANT_AUTO' + m.group(1) + \
+                               ' redundantly set to default value "latest" on line: %d'
+
 _constant_checks = tuple((c() for c in (
        EbuildHeader, EbuildWhitespace, EbuildQuote,
        EbuildAssignment, EbuildUselessDodoc,
        EbuildUselessCdS, EbuildNestedDie,
        EbuildPatches, EbuildQuotedA,
        IUseUndefined, ImplicitRuntimeDeps, InheritAutotools,
-       EMakeParallelDisabled, DeprecatedBindnowFlags)))
+       EMakeParallelDisabled, DeprecatedBindnowFlags,
+       WantAutoDefaultValue)))
 
 def run_checks(contents, pkg):
        checks = _constant_checks