[Piuparts-commits] [piuparts] 06/09: lib/db: rrdep accessors: use name lookup

Holger Levsen holger at moszumanska.debian.org
Sun Feb 9 20:59:28 UTC 2014


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit b1b09eb445e7ad4f9a10103df41f83cef5937ed3
Author: Andreas Beckmann <anbe at debian.org>
Date:   Thu May 30 11:05:04 2013 +0200

    lib/db: rrdep accessors: use name lookup
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 piupartslib/packagesdb.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 31d181b..cec6301 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -822,7 +822,8 @@ class PackagesDB:
 
         pkg.rdep_chain_len = chain_len
 
-    def block_count(self, pkg):
+    def block_count(self, name):
+        pkg = self.get_package(name)
         if pkg is None:
             return -1
         if pkg.block_cnt is None:
@@ -830,7 +831,8 @@ class PackagesDB:
 
         return pkg.block_cnt
 
-    def rrdep_count(self, pkg):
+    def rrdep_count(self, name):
+        pkg = self.get_package(name)
         if pkg is None:
             return -1
         if pkg.rrdep_cnt is None:
@@ -838,7 +840,8 @@ class PackagesDB:
 
         return pkg.rrdep_cnt
 
-    def waiting_count(self, pkg):
+    def waiting_count(self, name):
+        pkg = self.get_package(name)
         if pkg is None:
             return -1
         if pkg.waiting_cnt is None:
@@ -846,7 +849,8 @@ class PackagesDB:
 
         return pkg.waiting_cnt
 
-    def rdep_chain_len(self, pkg):
+    def rdep_chain_len(self, name):
+        pkg = self.get_package(name)
         if pkg is None:
             return -1
         if pkg.rdep_chain_len is None:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list