From 45a999ee823f6ffe243f3a292d2de4d559a18b29 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 28 Dec 2006 14:48:37 +0000 Subject: [PATCH] Make vardbapi.cpv_counter() use aux_get for caching. svn path=/main/trunk/; revision=5407 --- pym/portage.py | 4 ++++ 1 file changed, 4 insertions(+) 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" -- 2.26.2