[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.49-135-g41bea98

Andreas Beckmann anbe at debian.org
Sun Mar 3 17:22:20 UTC 2013


The following commit has been merged in the develop branch:
commit db9d6c27638eeb192d39c1dd6e342584859bae4f
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Sun Mar 3 17:59:44 2013 +0100

    lib/db: lookup providers recursively
    
    return the union of the providers from the current db
    and all dependency dbs
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 35d2b6e..f22ed07 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -597,10 +597,14 @@ class PackagesDB:
     def get_package(self, name):
         return self._packages[name]
 
-    def get_providers(self, name):
+    def get_providers(self, name, recurse=True):
+        providers = []
         if name in self._virtual_packages:
-            return self._virtual_packages[name]
-        return []
+            providers.extend(self._virtual_packages[name])
+        if recurse:
+            for db in self._dependency_databases:
+                providers.extend(db.get_providers(name, recurse=False))
+        return providers
 
     def get_all_packages(self):
         self._find_all_packages()

-- 
piuparts git repository



More information about the Piuparts-commits mailing list