[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.44-598-gace668e

Andreas Beckmann debian at abeckmann.de
Sun May 27 13:47:30 UTC 2012


The following commit has been merged in the piatti branch:
commit aff1d2c25f930b2560e4b0eeaf3e56bff6397c89
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Wed Mar 21 18:00:20 2012 +0100

    cache package.dependencies()
    
    do not recompute package.dependencies() for every loop
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 4817f6c..f70317c 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -364,13 +364,15 @@ class PackagesDB:
                     if prefer_alt_score >= 0:
                         package.prefer_alt_depends(header, d, prefer_alt)
 
-        for dep in package.dependencies():
+        deps = package.dependencies()
+
+        for dep in deps:
             dep_state = self.get_package_state(dep)
             if dep_state in self._dep_state_to_state:
                 return self._dep_state_to_state[dep_state]
 
         testable = True
-        for dep in package.dependencies():
+        for dep in deps:
             dep_state = self.get_package_state(dep)
             if dep_state not in \
                     ["successfully-tested", "essential-required"]:
@@ -382,7 +384,7 @@ class PackagesDB:
         # treat circular-dependencies as testable (for the part of the circle)
         if package["Package"] in self._known_circular_depends:
             testable = True
-            for dep in package.dependencies():
+            for dep in deps:
                 dep_state = self.get_package_state(dep)
                 if dep not in self._known_circular_depends and dep_state in \
                         ["successfully-tested", "essential-required"]:

-- 
piuparts git repository



More information about the Piuparts-commits mailing list