[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.44-583-ge144d01
Andreas Beckmann
debian at abeckmann.de
Fri May 25 12:40:55 UTC 2012
The following commit has been merged in the develop branch:
commit 19eeda3d4efb9d54be00490f50207c11b0ef1d0e
Author: Andreas Beckmann <debian at abeckmann.de>
Date: Wed Mar 21 18:00:18 2012 +0100
propagate error and waiting states separately
propagate waiting states after handling circular dependencies
as in some corner cases this could result in cycles waiting for itself
Signed-off-by: Andreas Beckmann <debian at abeckmann.de>
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index f70317c..ebb452a 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -220,17 +220,20 @@ class PackagesDB:
#"does-not-exist", # can only happen as query result for a dependency
]
- _dep_state_to_state = {
+ _propagate_error_state = {
"failed-testing": "dependency-failed-testing",
"cannot-be-tested": "dependency-cannot-be-tested",
- "waiting-to-be-tested": "waiting-for-dependency-to-be-tested",
- "waiting-for-dependency-to-be-tested": "waiting-for-dependency-to-be-tested",
"dependency-failed-testing": "dependency-failed-testing",
"dependency-cannot-be-tested": "dependency-cannot-be-tested",
"dependency-does-not-exist": "dependency-cannot-be-tested",
"does-not-exist": "dependency-does-not-exist",
}
+ _propagate_waiting_state = {
+ "waiting-to-be-tested": "waiting-for-dependency-to-be-tested",
+ "waiting-for-dependency-to-be-tested": "waiting-for-dependency-to-be-tested",
+ }
+
def __init__(self, logdb=None, prefix=None):
self.prefix = prefix
self._packages_files = []
@@ -368,8 +371,8 @@ class PackagesDB:
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]
+ if dep_state in self._propagate_error_state:
+ return self._propagate_error_state[dep_state]
testable = True
for dep in deps:
@@ -398,6 +401,11 @@ class PackagesDB:
if testable:
return "waiting-to-be-tested"
+ for dep in deps:
+ dep_state = self.get_package_state(dep)
+ if dep_state in self._propagate_waiting_state:
+ return self._propagate_waiting_state[dep_state]
+
return "unknown"
def _compute_package_states(self):
--
piuparts git repository
More information about the Piuparts-commits
mailing list