[Piuparts-commits] [piuparts] 07/09: don't pass package objects to rrdep accessors
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 2aba3f9c373876e50e02eaf2f12e3fdf0d658ec9
Author: Andreas Beckmann <anbe at debian.org>
Date: Sun Feb 9 19:18:19 2014 +0100
don't pass package objects to rrdep accessors
Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
master-bin/detect_well_known_errors.py | 11 +++--------
piuparts-report.py | 6 +++---
piupartslib/packagesdb.py | 2 +-
3 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index 10cc447..7674bc8 100755
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -239,9 +239,7 @@ class FailureManager():
self.pkgsdb = pkgsdb
def keyfunc(x, pkgsdb=self.pkgsdb, logdict=self.logdict):
-
- pkg_obj = pkgsdb.get_package(get_pkg(x.pkgspec))
- rdeps = pkgsdb.rrdep_count(pkg_obj)
+ rdeps = pkgsdb.rrdep_count(get_pkg(x.pkgspec))
is_failed = get_where(logdict[x.pkgspec]) == "fail"
@@ -382,9 +380,8 @@ def update_tpl(basedir, section, problem, failures, logdict, ftpl, ptpl, pkgsdb)
pkgspec = failure.pkgspec
bin_pkg = get_pkg(pkgspec)
-
+ rdep_cnt = pkgsdb.rrdep_count(bin_pkg)
pkg_obj = pkgsdb.get_package(bin_pkg)
- rdep_cnt = pkgsdb.rrdep_count(pkg_obj)
if not pkg_obj is None:
src_pkg = source_pkg(pkgspec, pkgsdb)
@@ -438,9 +435,7 @@ def update_html(section, logdict, problem_list, failures, config, pkgsdb):
for x in failedpkgs.difference(knownfailpkgs)]
def keyfunc(x, pkgsdb=pkgsdb, logdict=logdict):
-
- pkg_obj = pkgsdb.get_package(get_pkg(x.pkgspec))
- rdeps = pkgsdb.rrdep_count(pkg_obj)
+ rdeps = pkgsdb.rrdep_count(get_pkg(x.pkgspec))
is_failed = get_where(logdict[x.pkgspec]) == "fail"
diff --git a/piuparts-report.py b/piuparts-report.py
index 1d6969f..d49a4e0 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -1305,7 +1305,7 @@ class Section:
if state in self._binary_db.get_error_states():
with_counts = True
aside = " (reverse deps, blocked pkgs)"
- sort_key = lambda x: (-self._binary_db.block_count(x), x["Package"])
+ sort_key = lambda x: (-self._binary_db.block_count(x["Package"]), x["Package"])
else:
with_counts = False
aside = ""
@@ -1320,8 +1320,8 @@ class Section:
package2id(package["Package"]),
self.link_to_source_summary(package["Package"]))
if with_counts:
- vlist += " (%d, %d)" % (self._binary_db.rrdep_count(package), \
- self._binary_db.block_count(package))
+ vlist += " (%d, %d)" % (self._binary_db.rrdep_count(package["Package"]), \
+ self._binary_db.block_count(package["Package"]))
vlist += " (%s)" % html_protect(package["Maintainer"])
all_deps = unique(package.all_dependencies())
if all_deps:
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index cec6301..8d3fe9e 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -694,7 +694,7 @@ class PackagesDB:
if not self._logdb.log_exists(p, [self._reserved]) or \
self._logdb.log_exists(p, [self._recycle])]
if len(self._candidates_for_testing) > 1:
- tuples = [(self.waiting_count(p) * self.rdep_chain_len(p),
+ tuples = [(self.waiting_count(p["Package"]) * self.rdep_chain_len(p["Package"]),
random.random(), p)
for p in self._candidates_for_testing]
self._candidates_for_testing = [x[2]
--
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