Make vartree.getslot() use the dbapi for aux_get caching.
authorZac Medico <zmedico@gentoo.org>
Thu, 28 Dec 2006 14:40:57 +0000 (14:40 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 28 Dec 2006 14:40:57 +0000 (14:40 -0000)
svn path=/main/trunk/; revision=5406

pym/portage.py

index f2b11876c646aae16cd2dbc71ab65226d9b548f7..91121bbc8b39fae2109a55134ddcd128cee1674c 100644 (file)
@@ -5305,14 +5305,10 @@ class vartree(object):
 
        def getslot(self,mycatpkg):
                "Get a slot for a catpkg; assume it exists."
-               myslot = ""
                try:
-                       myslot=string.join(grabfile(self.root+VDB_PATH+"/"+mycatpkg+"/SLOT"))
-               except SystemExit, e:
-                       raise
-               except Exception, e:
-                       pass
-               return myslot
+                       return self.dbapi.aux_get(mycatpkg, ["SLOT"])[0]
+               except KeyError:
+                       return ""
 
        def hasnode(self,mykey,use_cache):
                """Does the particular node (cat/pkg key) exist?"""