---
britney.py | 24 +++++-------------------
britney_util.py | 15 +++++++++++++++
2 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/britney.py b/britney.py
index 0b9b588..7d683c3 100755
--- a/britney.py
+++ b/britney.py
@@ -214,7 +214,7 @@ from britney import buildSystem
from britney_util import (old_libraries_format, same_source, undo_changes,
register_reverses, compute_reverse_tree,
read_nuninst, write_nuninst, write_heidi,
- eval_uninst)
+ eval_uninst, newly_uninst)
from consts import (VERSION, SECTION, BINARIES, MAINTAINER, FAKESRC,
SOURCE, SOURCEVER, ARCHITECTURE, DEPENDS, CONFLICTS,
PROVIDES, RDEPENDS, RCONFLICTS)
@@ -1576,20 +1576,6 @@ class Britney(object):
# Upgrade run
# -----------
- def newlyuninst(self, nuold, nunew):
- """Return a nuninst statstic with only new uninstallable packages
-
- This method subtracts the uninstallable packages of the statistic
- `nunew` from the statistic `nuold`.
-
- It returns a dictionary with the architectures as keys and the list
- of uninstallable packages as values.
- """
- res = {}
- for arch in nuold:
- if arch not in nunew: continue
- res[arch] = [x for x in nunew[arch] if x not in nuold[arch]]
- return res
def get_nuninst(self, requested_arch=None, build=False):
"""Return the uninstallability statistic for all the architectures
@@ -2046,7 +2032,7 @@ class Britney(object):
self.output_write("endloop: %s\n" % (self.eval_nuninst(self.nuninst_orig)))
self.output_write(" now: %s\n" % (self.eval_nuninst(nuninst_comp)))
self.output_write(eval_uninst(self.options.architectures,
- self.newlyuninst(self.nuninst_orig, nuninst_comp)))
+ newly_uninst(self.nuninst_orig, nuninst_comp)))
self.output_write("\n")
return (nuninst_comp, extra)
@@ -2110,7 +2096,7 @@ class Britney(object):
if not force:
self.output_write(eval_uninst(self.options.architectures,
- self.newlyuninst(nuninst_start, nuninst_end)) + "\n")
+ newly_uninst(nuninst_start, nuninst_end)) + "\n")
if force or self.is_nuninst_asgood_generous(self.nuninst_orig, nuninst_end):
# Result accepted either by force or by being better than the original result.
@@ -2126,7 +2112,7 @@ class Britney(object):
if force:
self.output_write("force breaks:\n")
self.output_write(eval_uninst(self.options.architectures,
- self.newlyuninst(nuninst_start, nuninst_end)) + "\n")
+ newly_uninst(nuninst_start, nuninst_end)) + "\n")
self.output_write("SUCCESS (%d/%d)\n" % (len(actions or self.upgrade_me), len(extra)))
self.nuninst_orig = nuninst_end
if not actions:
@@ -2261,7 +2247,7 @@ class Britney(object):
def printuninstchange(self):
self.__log("Checking for newly uninstallable packages", type="I")
- text = eval_uninst(self.options.architectures, self.newlyuninst(
+ text = eval_uninst(self.options.architectures, newly_uninst(
self.nuninst_orig_save, self.nuninst_orig))
if text != '':
diff --git a/britney_util.py b/britney_util.py
index c2c9cb0..66d949b 100644
--- a/britney_util.py
+++ b/britney_util.py
@@ -293,6 +293,21 @@ def read_nuninst(filename, architectures):
return nuninst
+def newly_uninst(nuold, nunew):
+ """Return a nuninst statstic with only new uninstallable packages
+
+ This method subtracts the uninstallable packages of the statistic
+ "nunew" from the statistic "nuold".
+
+ It returns a dictionary with the architectures as keys and the list
+ of uninstallable packages as values.
+ """
+ res = {}
+ for arch in ifilter_only(nunew, nuold):
+ res[arch] = [x for x in nunew[arch] if x not in nuold[arch]]
+ return res
+
+
def eval_uninst(architectures, nuninst):
"""Return a string which represents the uninstallable packages
--
1.7.10.4
diff -u b/britney_util.py b/britney_util.py
--- b/britney_util.py
+++ b/britney_util.py
@@ -27,7 +27,7 @@
version numbers specified as parameters are built from the same
source. The main use of this code is to detect binary-NMU.
- binnmu_re is an opt to avoid "load global".
+ binnmu_re is an optimization to avoid "load global".
"""
if sv1 == sv2:
return 1
diff -u b/britney_util.py b/britney_util.py
--- b/britney_util.py
+++ b/britney_util.py
@@ -54,7 +54,7 @@
If given an iterable it returns a filtered iterator, otherwise it
returns a function to generate filtered iterators. The latter is
useful if the same filter has to be (re-)used on multiple
- iterators that are not known on before hand.
+ iterators that are not known on beforehand.
"""
if iterable is not None:
return ifilterfalse(container.__contains__, iterable)
@@ -67,7 +67,7 @@
If given an iterable it returns a filtered iterator, otherwise it
returns a function to generate filtered iterators. The latter is
useful if the same filter has to be (re-)used on multiple
- iterators that are not known on before hand.
+ iterators that are not known on beforehand.
"""
if iterable is not None:
return ifilter(container.__contains__, iterable)
diff -u b/britney_util.py b/britney_util.py
--- b/britney_util.py
+++ b/britney_util.py
@@ -171,8 +171,8 @@
sequence of packages
This method registers the reverse dependencies and conflicts for a
- given sequence of packages. `packages` is a table of real
- packages and `provides` is a table of virtual packages.
+ given sequence of packages. "packages" is a table of real
+ packages and "provides" is a table of virtual packages.
iterator is the sequence of packages for which the reverse
relations should be updated.
diff -u b/britney_util.py b/britney_util.py
--- b/britney_util.py
+++ b/britney_util.py
@@ -226,15 +226,15 @@
"""Calculate the full dependency tree for the given package
This method returns the full dependency tree for the package
- `pkg`, inside the `arch` architecture for a given suite flattened
- as an iterable. The first argument `packages_s` is the binary
+ "pkg", inside the "arch" architecture for a given suite flattened
+ as an iterable. The first argument "packages_s" is the binary
package table for that given suite (e.g. Britney().binaries["testing"]).
- The tree (or grapH) is returned as an iterable of (package, arch)
- tuples and the iterable will contain (`pkg`, `arch`) if it is
+ The tree (or graph) is returned as an iterable of (package, arch)
+ tuples and the iterable will contain ("pkg", "arch") if it is
available on that architecture.
- If `pkg` is not available on that architecture in that suite,
+ If "pkg" is not available on that architecture in that suite,
this returns an empty iterable.
The method does not promise any ordering of the returned
diff -u b/britney_util.py b/britney_util.py
--- b/britney_util.py
+++ b/britney_util.py
@@ -265,8 +265,8 @@
def write_nuninst(filename, nuninst):
"""Write the non-installable report
- Write the non-installable report derived from `nuninst` to the
- file denoted by `filename`.
+ Write the non-installable report derived from "nuninst" to the
+ file denoted by "filename".
"""
with open(filename, 'w') as f:
# Having two fields with (almost) identical dates seems a bit
@@ -280,7 +280,7 @@
"""Read the non-installable report
Read the non-installable report from the file denoted by
- `filename` and return it. Only architectures in `architectures`
+ "filename" and return it. Only architectures in "architectures"
will be included in the report.
"""
nuninst = {}
diff -u b/britney_util.py b/britney_util.py
--- b/britney_util.py
+++ b/britney_util.py
@@ -304,8 +304,8 @@
<pkg-name> <pkg-version> <pkg-architecture> <pkg-section>
<src-name> <src-version> source <src-section>
- The file is written as `filename`, it assumes all sources and
- packages in `sources_t` and `packages_t` to be the packages in
+ The file is written as "filename", it assumes all sources and
+ packages in "sources_t" and "packages_t" to be the packages in
"testing".
The "X=X" parameters are optimizations to avoid "load global" in
diff -u b/britney_util.py b/britney_util.py
--- b/britney_util.py
+++ b/britney_util.py
@@ -297,7 +297,7 @@
"""Return a string which represents the uninstallable packages
This method returns a string which represents the uninstallable
- packages reading the uninstallability statistics `nuninst`.
+ packages reading the uninstallability statistics "nuninst".
An example of the output string is:
* i386: broken-pkg1, broken-pkg2
diff -u b/britney_util.py b/britney_util.py
--- b/britney_util.py
+++ b/britney_util.py
@@ -297,7 +297,7 @@
"""Return a nuninst statstic with only new uninstallable packages
This method subtracts the uninstallable packages of the statistic
- `nunew` from the statistic `nuold`.
+ "nunew" from the statistic "nuold".
It returns a dictionary with the architectures as keys and the list
of uninstallable packages as values.
Reply to: