summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-28 14:48:37 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-28 14:48:37 +0000
commit45a999ee823f6ffe243f3a292d2de4d559a18b29 (patch)
treeef96fce48dee21a92291defa5029baf15d701767
parent962b3aa1fcc5614fb34f2184d11bc2877ff05997 (diff)
downloadportage-45a999ee823f6ffe243f3a292d2de4d559a18b29.tar.gz
portage-45a999ee823f6ffe243f3a292d2de4d559a18b29.tar.bz2
portage-45a999ee823f6ffe243f3a292d2de4d559a18b29.zip
Make vardbapi.cpv_counter() use aux_get for caching.
svn path=/main/trunk/; revision=5407
-rw-r--r--pym/portage.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 91121bbc8..057c3e11d 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -4719,6 +4719,10 @@ class vardbapi(dbapi):
def cpv_counter(self,mycpv):
"This method will grab the COUNTER. Returns a counter value."
+ try:
+ return long(self.aux_get(mycpv, ["COUNTER"])[0])
+ except KeyError, ValueError:
+ pass
cdir=self.root+VDB_PATH+"/"+mycpv
cpath=self.root+VDB_PATH+"/"+mycpv+"/COUNTER"