Make binarytree.populate() stop relying on having a categories
authorZac Medico <zmedico@gentoo.org>
Thu, 20 Dec 2007 06:00:10 +0000 (06:00 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 20 Dec 2007 06:00:10 +0000 (06:00 -0000)
list since it may not be available if there is no portage tree.

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

pym/portage/dbapi/bintree.py

index b354f9aeea8a1bdbaa086d35428a9b818071206d..c3c514a4e92722fc1150ed5f4cb01057135bef8e 100644 (file)
@@ -358,8 +358,6 @@ class binarytree(object):
                if (not os.path.isdir(self.pkgdir) and not getbinpkgs):
                        return 0
 
-               categories = set(self.settings.categories)
-
                if not getbinpkgsonly:
                        pkg_paths = {}
                        self._pkg_paths = pkg_paths
@@ -496,7 +494,7 @@ class binarytree(object):
                                        if mycpv in pkg_paths:
                                                # All is first, so it's preferred.
                                                continue
-                                       if mycat not in categories:
+                                       if not mycat:
                                                writemsg(("!!! Binary package has an " + \
                                                        "unrecognized category: '%s'\n") % full_path,
                                                        noiselevel=-1)
@@ -656,7 +654,7 @@ class binarytree(object):
                                        continue
                                mycat = self.remotepkgs[mypkg]["CATEGORY"].strip()
                                fullpkg = mycat+"/"+mypkg[:-5]
-                               if mycat not in categories:
+                               if not mycat:
                                        writemsg(("!!! Remote binary package has an " + \
                                                "unrecognized category: '%s'\n") % fullpkg,
                                                noiselevel=-1)