Use Package.invalid to generate *.syntax repoman errors for LICENSE,
authorZac Medico <zmedico@gentoo.org>
Sun, 28 Jun 2009 19:40:39 +0000 (19:40 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 28 Jun 2009 19:40:39 +0000 (19:40 -0000)
PROPERTIES, PROVIDE, and RESTRICT.

svn path=/main/trunk/; revision=13728

bin/repoman
pym/_emerge/Package.py

index 09b79da2351758ca8f78329eb9f7b1da395ed3ad..3ea879c35835fc067036cbf09872126ff2ba51fa 100755 (executable)
@@ -1199,6 +1199,14 @@ for x in scanlist:
                        continue
 
                pkg = pkgs[y]
+
+               if pkg.invalid:
+                       for k, msgs in pkg.invalid.iteritems():
+                               for msg in msgs:
+                                       stats[k] = stats[k] + 1
+                                       fails[k].append("%s %s" % (relative_path, msg))
+                       continue
+
                myaux = pkg.metadata
                eapi = myaux["EAPI"]
                inherited = pkg.inherited
@@ -1232,21 +1240,9 @@ for x in scanlist:
                                        "%s: '%s' found in thirdpartymirrors" % \
                                        (relative_path, mirror))
 
-               # Test for negative logic and bad words in the RESTRICT var.
-               #for x in myaux[allvars.index("RESTRICT")].split():
-               #       if x.startswith("no"):
-               #               print "Bad RESTRICT value: %s" % x
-               try:
-                       portage.dep.use_reduce(
-                               portage.dep.paren_reduce(myaux["PROVIDE"]), matchall=1)
-               except portage.exception.InvalidDependString, e:
-                       stats["PROVIDE.syntax"] = stats["PROVIDE.syntax"] + 1
-                       fails["PROVIDE.syntax"].append(mykey+".ebuild PROVIDE: "+str(e))
-                       del e
-                       continue
-
                # The Package class automatically evaluates USE conditionals.
-               for myprovide in myaux["PROVIDE"].split():
+               for myprovide in portage.flatten(portage.dep.use_reduce(
+                       portage.dep.paren_reduce(pkg.metadata['PROVIDE']), matchall=1)):
                        prov_cp = portage.dep_getkey(myprovide)
                        if prov_cp != myprovide:
                                stats["virtual.versioned"]+=1
index 512703b8318e6d1507e36307c37d7723754cf66b..c2eaf0ee6593158858fa25a324da7b43544ac815 100644 (file)
@@ -187,14 +187,10 @@ class _PackageMetadataWrapper(_PackageMetadataWrapperBase):
        def __getitem__(self, k):
                v = _PackageMetadataWrapperBase.__getitem__(self, k)
                if k in self._use_conditional_keys:
-                       if '?' in v:
+                       if self._pkg.root_config.settings.local_config and '?' in v:
                                try:
-                                       if self._pkg.root_config.settings.local_config:
-                                               v = paren_enclose(paren_normalize(use_reduce(
-                                                       paren_reduce(v), uselist=self._pkg.use.enabled)))
-                                       else:
-                                               v = paren_enclose(paren_normalize(use_reduce(
-                                                       paren_reduce(v), matchall=1)))
+                                       v = paren_enclose(paren_normalize(use_reduce(
+                                               paren_reduce(v), uselist=self._pkg.use.enabled)))
                                except portage.exception.InvalidDependString:
                                        # This error should already have been registered via
                                        # self._pkg._invalid_metadata().