Use regex category validation in binarytree.populate().
authorZac Medico <zmedico@gentoo.org>
Fri, 21 Dec 2007 01:23:28 +0000 (01:23 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 21 Dec 2007 01:23:28 +0000 (01:23 -0000)
svn path=/main/trunk/; revision=9012

pym/portage/dbapi/bintree.py

index e950b2052093e29fe50ddac8e5fd8d82d4a3ffd4..91695a456a08a0e563d8a04889a2111ff7ff2607 100644 (file)
@@ -494,7 +494,7 @@ class binarytree(object):
                                        if mycpv in pkg_paths:
                                                # All is first, so it's preferred.
                                                continue
-                                       if not mycat:
+                                       if not self._category_re.match(mycat):
                                                writemsg(("!!! Binary package has an " + \
                                                        "unrecognized category: '%s'\n") % full_path,
                                                        noiselevel=-1)
@@ -654,7 +654,7 @@ class binarytree(object):
                                        continue
                                mycat = self.remotepkgs[mypkg]["CATEGORY"].strip()
                                fullpkg = mycat+"/"+mypkg[:-5]
-                               if not mycat:
+                               if not self._category_re.match(mycat):
                                        writemsg(("!!! Remote binary package has an " + \
                                                "unrecognized category: '%s'\n") % fullpkg,
                                                noiselevel=-1)