[Piuparts-commits] [SCM] piuparts git repository branch, bikeshed, updated. 0.53-17-g6cee1ba
Holger Levsen
holger at layer-acht.org
Sun Jul 7 11:41:41 UTC 2013
The following commit has been merged in the bikeshed branch:
commit bb014fe0a2b499be4af5e5bb2b07baaf65bc4983
Author: David Steele <dsteele at gmail.com>
Date: Fri Mar 1 22:42:17 2013 -0500
Use the on-demand versions of the rdep metric calls.
diff --git a/master-bin/detect_well_known_errors.py b/master-bin/detect_well_known_errors.py
index e609325..490732a 100755
--- a/master-bin/detect_well_known_errors.py
+++ b/master-bin/detect_well_known_errors.py
@@ -231,7 +231,7 @@ class FailureManager():
pkg_obj = pkgsdb.get_package(get_pkg(x.pkgspec))
if not pkg_obj is None:
- rdeps = pkg_obj.rrdep_count()
+ rdeps = pkgsdb.rrdep_count(pkg_obj)
else:
rdeps = 0
@@ -383,7 +383,7 @@ def update_tpl(basedir, section, problem, failures, logdict, ftpl, ptpl, pkgsdb)
if not pkg_obj is None:
src_pkg = source_pkg(pkgspec, pkgsdb)
- rdep_cnt = pkg_obj.rrdep_count()
+ rdep_cnt = pkgsdb.rrdep_count(pkgsdb.get_package(bin_pkg))
else:
src_pkg = bin_pkg
rdep_cnt = 0
@@ -439,7 +439,7 @@ def update_html(section, logdict, problem_list, failures, config, pkgsdb):
pkg_obj = pkgsdb.get_package(get_pkg(x.pkgspec))
if not pkg_obj is None:
- rdeps = pkg_obj.rrdep_count()
+ rdeps = pkgsdb.rrdep_count(pkg_obj)
else:
rdeps = 0
@@ -492,7 +492,6 @@ def process_section(section, config, problem_list,
section_config.get_arch()))
pkgsdb.compute_package_states()
- pkgsdb.calc_rrdep_counts()
failures = FailureManager(logdict)
failures.sort_by_bugged_and_rdeps(pkgsdb)
diff --git a/piuparts-report.py b/piuparts-report.py
index cea629f..43790da 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -633,7 +633,6 @@ class Section:
self._load_package_database(section, master_directory)
self._binary_db = self._package_databases[section]
self._binary_db.compute_package_states()
- self._binary_db.calc_rrdep_counts()
self._source_db = piupartslib.packagesdb.PackagesDB()
self._source_db.load_packages_urls(
@@ -1257,24 +1256,18 @@ class Section:
with_counts = True
aside = " (reverse deps, blocked pkgs)"
- def cmp_func(a, b):
- """Sort by block count first"""
- rrdep_cmp = cmp(a.block_count(), b.block_count())
- if rrdep_cmp != 0:
- return -rrdep_cmp
- else:
- return cmp(a["Package"], b["Package"])
-
names = self._binary_db.get_pkg_names_in_state(state)
packages = [self._binary_db.get_package(name) for name in names]
- packages.sort(cmp_func)
+ packages.sort( key =
+ lambda x: (-self._binary_db.block_count(x),x["Package"]))
for package in packages:
vlist += "<li id=\"%s\">%s" % (
package["Package"],
self.link_to_source_summary(package["Package"]))
if with_counts:
- vlist += " (%d, %d)" % (package.rrdep_count(), package.block_count())
+ vlist += " (%d, %d)" % (self._binary_db.rrdep_count(package), \
+ self._binary_db.block_count(package))
vlist += " (%s)" % html_protect(package["Maintainer"])
all_deps = package.all_dependencies()
if all_deps:
diff --git a/piupartslib/packagesdb.py b/piupartslib/packagesdb.py
index 17cc4e1..5d8d866 100644
--- a/piupartslib/packagesdb.py
+++ b/piupartslib/packagesdb.py
@@ -692,8 +692,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:
- self.calc_rrdep_counts()
- tuples = [(p.waiting_count(), random.random(), p)
+ tuples = [(self.waiting_count(p), random.random(), p)
for p in self._candidates_for_testing]
self._candidates_for_testing = [x[2]
for x in sorted(tuples, reverse = True)]
--
piuparts git repository
More information about the Piuparts-commits
mailing list