66 Commits

Author SHA1 Message Date
Dimitri John Ledkov
420e83b2ca Teach excuse_unsat_deps() about components ogre model 2016-10-11 10:56:51 +02:00
Colin Watson
372c34783a Link to wiki documentation 2016-10-11 10:56:51 +02:00
Colin Watson
75dcfddccd Make sure that containing directories exist before writing output files
We don't use os.makedirs(dir, exist_ok=True) as that is too strict: it fails if
the directory already exists with different permissions (e. g. with 775). Thus
introduce a helper function ensuredir().
2016-10-11 09:25:50 +02:00
Colin Watson
fe7cc466e1 Rename fucked_arches to outofsync_arches
To avoid getting in trouble when bringing up new commercially-supported
architectures.

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-10-03 18:29:09 +00:00
Niels Thykier
0664c580b0 Prefer s.x to s[X] for SourcePackage objects
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-10-03 18:29:09 +00:00
Niels Thykier
ea166f5bd3 britney -> util: Extract a "create_provides_map"
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-10-03 18:05:54 +00:00
Niels Thykier
463d1a67d9 Prefer pkg_id.foo to pkg_id[X]
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-05-28 09:37:28 +00:00
Niels Thykier
bee0a99528 Reuse pkg_ids instead of creating them ad-hoc
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-05-28 09:37:28 +00:00
Niels Thykier
93757b5650 Omit faux packages from the HeidiResult file
We do not need these in the HeidiResult file, so we might as well stop
emitting them.  Note that faux packages will still appear in other
output (like the "uninst" lists/caches).

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-05-22 05:48:51 +00:00
Niels Thykier
ccb473e19f britney.py: Support compressed Packages/Sources
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-05-21 12:47:28 +00:00
Niels Thykier
7ccbfe2fdf Make "Keep-installable" constraints overrule nuninst counters
If there is a regression in "present-and-installable" constraints (on
non-break architectures), then discard the item even if the nuninst
counters have improved.

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-05-21 12:47:27 +00:00
Niels Thykier
e92bbf386f britney_util: Replace broken if with an assert
Replace a "if" with an unconditionally false condition with a negative
assert of the "correct" condition.  The bug has been present for 2½
years with no known adverse effects.

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-05-21 12:43:38 +00:00
Niels Thykier
ec37bd06aa Optimise checking of affected packages
For (non-hint) migrations, split the set of affected into two
parts; one for reverse dependencies and one "negative dependencies"
(e.g. Conflicts).

If there are only regressions in the nuninst after checking the first
set, then there is no reason to continue with the second set (as
"negative dependencies" can only make it worse at that point).

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-05-21 12:43:38 +00:00
Niels Thykier
8991889fad Prefer pkg.foo to pkg[FOO] for binary packages
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-05-21 12:43:38 +00:00
Niels Thykier
2e81e55c56 undo_items: Gracefully handle skipped cruft items in undo
In 203466b, we stopped migrating cruft items if they were not in
testing already.  However, if the migration failed we would still
attempt to undo it from testing, which (unsurprisingly) does not work
very well.

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-27 17:11:34 +00:00
Niels Thykier
37b6536cfd Remove two redundant ifs duplicating an earlier if
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:27 +00:00
Niels Thykier
2b5c48ad2f Remove redundant assert
We asserted that a list of packages was a subset of the "affected"
set.  This was a given, since the list was seeded *only* with packages
from affected (and only if their installability changed).

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:27 +00:00
Niels Thykier
38a198e8b2 Replace some string concat+split with tuples
Replace some of the:

 p = binary + "/" + parch
 binary, parch = p.split("/")

with regular tuples.

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:27 +00:00
Niels Thykier
b5db57715b Move two installability testing functions to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:27 +00:00
Niels Thykier
05de911090 Make excuses a dict rather than a list
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:27 +00:00
Niels Thykier
842a97adbd britney_util: Remove some unused imports
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:26 +00:00
Niels Thykier
12d9ae8fa3 Use pkg_id instead pkg/arch in BINARIES
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:26 +00:00
Niels Thykier
aa34a47f8a Remove all calls to "same_source" - they were overkill
The same_source is supposed to compare two versions and (if needed)
"massage" a binNMU version into a source version.  This extra feature
of same_source happens to be unused (and not generally applicable):

 1) We always compare two source versions, so there is never a
    binNMU version in the first place.
 2) binary versions are *not* always equal to their source version
    (even with the binNMU suffix stripped).  This happens when
    packages use "dpkg-gencontrol -v<version>".

Note this causes results from some live-data tests to change, because
there has been a sourceful upload with a binNMU version.  It was
intended as a binNMU, but was uploaded with the source as well.  As
Britney no longer works around this issue, it makes her remove the
affected packages in the end (as their source version does not match
the version in testing).

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:26 +00:00
Niels Thykier
7fcb6e3354 Partially support versioned provides
With this patch, Britney will correctly parse (and deparse) a
versioned Provides.  Furthermore, she will allow it to satisfy any
unversioned dependency on the provided package.

This is the easy half of #786803.

Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:26 +00:00
Niels Thykier
19e54380c3 Store the pkg_id in undo instead of the package info
Signed-off-by: Niels Thykier <niels@thykier.net>
2016-04-11 16:27:26 +00:00
Niels Thykier
a9ee64470e Always use pkg ids in the InstallabilityTester API
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-13 20:33:06 +02:00
Niels Thykier
7736b53c60 Drop now unused register_reverses and RDEPENDS
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-13 19:33:22 +02:00
Niels Thykier
5123bc2317 Remove the now unused RCONFLICTS field
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-09 21:06:06 +02:00
Niels Thykier
289807463e Rewrite computation and testing of "affected" packages
Rely on the Installability tester to locate all of the affected
packages plus their transitive reverse dependencies.  As the
InstallabilityTester is suite agnostic, the set of affected packages
now includes (versions of) packages not in testing, which is filtered
out during the check.

Signed-off-by: Niels Thykier <niels@thykier.net>
2015-09-09 21:06:06 +02:00
Ivo De Decker
984b07b58e Don't remove outdated binaries for fucked arches if they are in unstable
For fucked architectures, binaries from older versions are allowed to be in
testing, so we only remove them if they are gone from unstable.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2015-09-06 17:08:32 +00:00
Ivo De Decker
3326f948db Cleanup old binaries even when they are still in unstable
Old binaries in testing are usually old versions of libraries that where
smooth-updated. These should only be kept in testing as long as they are
needed to install other packages in testing. When they are no longer needed,
they can be removed, even if the old library is still in unstable (where it
might be needed for reverse dependencies which are not in testing).

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2015-09-06 15:22:52 +00:00
Niels Thykier
5f98e6b37b Create a clone_nuninst function for iter_packages{,_hint}
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:33:52 +02:00
Niels Thykier
875f3eebea britney_util: Typo fix
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-06-02 21:29:47 +02:00
Niels Thykier
074eb46766 Remove unused assignments/parameters
Signed-off-by: Niels Thykier <niels@thykier.net>
2015-04-26 18:20:11 +02:00
Julien Cristau
994906c673 Add explicit encoding to all files
Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-04-26 18:20:10 +02:00
Julien Cristau
6c344589ee Remove dependency on six
Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-04-26 18:20:10 +02:00
Julien Cristau
18f7101847 Use six.moves for itertools, urllib and intern
They're renamed in python3.

Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-04-26 18:20:10 +02:00
Julien Cristau
2eee806263 Stop using dict.iter* methods
Signed-off-by: Julien Cristau <jcristau@debian.org>
2015-04-26 18:20:09 +02:00
Niels Thykier
a2d63a1c73 Move the nuninst checker function to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2014-08-05 07:56:29 +02:00
Niels Thykier
d359759e9d Move "old_libraries" to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2014-03-10 18:48:04 +01:00
Niels Thykier
5ddd9ebc36 Move write_controlfiles to britney_util
Signed-off-by: Niels Thykier <niels@thykier.net>
2014-03-10 18:48:04 +01:00
Niels Thykier
b429d4871e Factor write_sources into its own function
Signed-off-by: Niels Thykier <niels@thykier.net>
2014-03-10 18:48:04 +01:00
Niels Thykier
691bda4bd8 Write "HeidiResultDelta" file containing the changes of the run
Based on Colin Watson's code to do the same from the "britney2-ubuntu"
repository[1] revision 306, 308 and 309.

Notable differences include:
 * output include version of source package being removed
 * output prefix removals with a "-" (otherwise it would be identical to
   a upgrade/new source with the change above).

[1] http://bazaar.launchpad.net/~ubuntu-release/britney/britney2-ubuntu/revision/306

Signed-off-by: Niels Thykier <niels@thykier.net>
2014-01-11 09:03:16 +01:00
Niels Thykier
90f1e91c74 excuse: Rename "generated" to "generated-date"
"generated-date" suggests the value as a date, whereas "generated"
suggests a boolean value.

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-12-11 21:21:15 +01:00
Niels Thykier
a378bb6060 util: Add new "write_excuses" function
Signed-off-by: Niels Thykier <niels@thykier.net>
2013-12-11 21:21:15 +01:00
Adam D. Barratt
2f753eab70 Only output arch:all packages which correspond to the testing source
If an architecture is marked as fucked, britney's package list for that
architecture may include arch:all packages for an older version. When
outputting the result file, we should not include those packages as
they will lead to import failures.

Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-12-02 09:15:32 +00:00
Niels Thykier
7051d5b0e9 Rewrite installability tester
The new Installability Tester (IT) module replaces the remaining
C-parts.  Unlike C-implementation, it does not give up and emit an
"AIEEE" half-way through.

In order to determine installability, it uses two sets "musts" and
"never".  As the names suggest, the sets represents the packages that
must be (co-)installable with the package being tested and those that
can never be co-installable.  For a package to be installable, "musts"
and "never" have remain disjoint.

These sets are also used to reduce the number of alternatives that are
available to satisfy a given dependency.  When these sets are unable
to remove the choice completely, the new IT defers the choice to later.
This occasionally reduces backtracking as a later package may conflict
or unconditionally depend on one of the remaining alternatives.

Signed-off-by: Niels Thykier <niels@thykier.net>
2013-11-27 19:46:59 +01:00
Adam D. Barratt
253590ba27 Update copyright
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-09-07 18:21:00 +00:00
Adam D. Barratt
1b89f7fa22 Rename make_hintitem() to make_migrationitem()
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-09-07 18:19:17 +00:00
Adam D. Barratt
77e8c656ff britney_util: fix imports for the MigrationItem class rename
Signed-off-by: Adam D. Barratt <adam@adam-barratt.org.uk>
2013-09-07 17:08:21 +00:00