88 Commits

Author SHA1 Message Date
Iain Lane
c9d45ecb2b Support writing excuses YAML to xz and gz files 2020-11-20 17:37:44 +00:00
Iain Lane
7ed335893e Implement Ubuntu component relationship constraints (ogre model) 2020-11-11 09:41:40 +00:00
Iain Lane
3fa9eceb89 Store the component in BinaryPackage and SourcePackage 2020-11-11 09:41:40 +00:00
Iain Lane
77a2a0df19 utils: Fix pycodestyle E302 (missing blank line) 2020-10-20 14:57:51 +01:00
Colin Watson
3b8daa98ec
Make sure that containing directories exist before writing output files 2020-06-11 13:00:02 +01:00
Ivo De Decker
920d82445d Add allow-smooth-update hint
Hint to allow smooth update, even if the section isn't allowed in the
configuration.

Note that this takes the source name and the source version IN TESTING
of the binaries that must be allowed to stay around to allow a smooth
update.
2020-04-01 16:37:56 +00:00
Ivo De Decker
c2088004f2 is_smooth_update_allowed: strip component from section 2020-04-01 15:55:03 +00:00
Ivo De Decker
2d34f8220e split off is_smooth_update_allowed() function 2020-04-01 15:49:14 +00:00
Ivo De Decker
9865db0448 Add find_newer_binaries function 2020-03-18 21:15:25 +00:00
Ivo De Decker
29557abab0 Replace broken excuse dependency code with comment 2020-03-18 21:13:05 +00:00
Ivo De Decker
c410435859 use uvname for dependencies between excuses 2020-01-30 18:40:24 +01:00
Ivo De Decker
ef2cae9be5 remove unused function 2020-01-30 15:09:17 +00:00
Ivo De Decker
03fc5208fc remove TPU check that's no longer needed 2020-01-30 15:09:17 +00:00
Ivo De Decker
2ccb056fa1 validate list of valid excuses 2020-01-30 15:09:12 +00:00
Ivo De Decker
8b6638c566 Specify dependencies between excuses based on packages
Rework the dependencies between excuses.

Dependencies are specified based on packages (source or binary). Based
on these packages, dependencies on other excuses (that have these
packages) are calculated.

As with package dependencies, dependencies between excuses can contain
alternatives.

Each alternative can satisfy the dependency, so the excuse only becomes
invalid if all of the alternatives of a specific dependency are
invalidated.

Tracking of the alternatives and their validity is moved to separate
objects.
2020-01-30 15:09:12 +00:00
Ivo De Decker
3c8b7ba11d Add source to SourcePackage object
Adding a source parameter to the SourcePackage allow finding the source
the object is referring to, so that parameter doesn't have to be passed
along separately.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2020-01-03 19:44:55 +00:00
Niels Thykier
0d5ea5eb8c
Improve cache invalidation of (pseudo-)essential set
If a new pseudo-essential package was added to testing *and* it is
mutually-exclusive with an existing member, britney would incorrectly
flag it as uninstallable (unless another change triggered a cache
invalidation of the pseudo-essential set).

With this commit, the cache invalidation is now done based on whether
we add something that *might* be in the (effective) pseudo-essential
set.  It is an overapproximation as there are cases where the
invalidation is unnecessary, but at the moment it is not a performance
concern.

Closes: https://bugs.debian.org/944190
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-11-10 23:08:47 +00:00
Ivo De Decker
8d5805b8de Don't allow smooth update if section not in s-u config
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-11-06 13:32:33 +00:00
Ivo De Decker
301298e8c4 Add comment to clarify smooth update code 2019-11-05 20:09:08 +01:00
Niels Thykier
2a1e4386fd
Remove optimization invalidated by allow-uninst hint
The optimizations relies on assumptions that are not valid with the
allow-uninst that has not been corrected.  When these assumptions, we
end up with invalid nuninst counters.

Signed-off-by: Niels Thykier <niels@thykier.net>
2019-10-26 07:07:55 +00:00
Ivo De Decker
93b46dde0d Allow new uninstallables from allow-uninst hint
When an allow-uninst hint is added for an unversioned binary package, items
are allowed to migrate, even if they make that binary package uninstallable
(on the architecture specified in the hint, if one was specified, or on all
architectures otherwise).

Using this hint should avoid using force-hint to allow specific breakage.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-09-14 11:52:19 +00:00
Ivo De Decker
90cb743410 switch rdep invalidation to detailed excuse info 2019-09-04 11:44:12 +00:00
Ivo De Decker
b70d1d09d7 keep track of verdict when invalidating deps 2019-09-04 11:44:10 +00:00
Niels Thykier
c741b03aaf
Make PolicyVerdict ordered/comparable
This shortens the annyoing "a.value < b.value" to "a < b".

Signed-off-by: Niels Thykier <niels@thykier.net>
2019-03-06 19:07:17 +00:00
Niels Thykier
533288fa3e
utils: Remove obsolete imports
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-03-05 19:40:39 +00:00
Niels Thykier
915b4a012d
Since dpkg/1.19.1, "foo:native" is also valid for arch:all pkgs
We allow this already now even though dpkg/1.19.1 is not in stable as
it will not cause issues with upgrades (only dpkg-checkbuilddeps
needed change, so it will not cause issues on the buildds as we can
rely on dpkg from buster being present there).

Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-29 19:15:15 +00:00
Niels Thykier
e0b46e5196
Make the source pkg consistency checks a TargetSuite method
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 16:47:40 +00:00
Niels Thykier
b200c15062
Add a missing "no cover"
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 13:06:19 +00:00
Ivo De Decker
4fcb90b775
Read Built-Using info for binary packages
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-19 12:45:06 +00:00
Niels Thykier
bb699f7416
Make britney2/utils.py PEP-8 clean
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 12:03:36 +00:00
Niels Thykier
5a38e00996
Fix pep8 issues in check_target_suite_source_pkg_consistency
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-19 12:03:35 +00:00
Niels Thykier
82fa58df20 Extract a compute_item_name method
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-16 22:37:23 +00:00
Niels Thykier
f928c7ed3d Make SourcePackage.binaries a set
The recent code changes made use remove from the "binaries" field in
SourcePackages.  Lists are not particularly optimized for this kind
of removal and we have a few source packages with a lot of binary
packages (e.g. libreoffice, gcc-X-cross{,-ports}) that might trip
poor performance.

Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-14 13:19:05 +00:00
Ivo De Decker
046bdc60c6 Add consistency checks for target suite.
This test checks if every binary in the target suite is listed as a binary for
its source package and vice-versa.

This adds a config option check_consistency_level:

0: no checks
1: only check at the end
2: also check for every hint run (default)
3: check for every transaction (slow - only useful for the testsuite)

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-14 13:13:45 +00:00
Niels Thykier
2fea931da3
Remove --control-files; It is not used any where
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-07 20:25:48 +00:00
Niels Thykier
b16ae8046a
Add some '# pragma: no cover' for error cases, abstract methods, etc.
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-31 18:07:29 +00:00
Niels Thykier
5bcbed499e
Fix the doc string for compile_nuninst
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-31 12:16:09 +00:00
Niels Thykier
6174d2c3f9
Create a MigrationItemFactory and migrate most code to use it
This is a step towards making migration unit-testable.  This step
reduces the need for global state (in the MigrationItem class as class
fields) and with another step we can remove the global state entirely
and enable unit tests to create migration items without having to
worry about other unit tests.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-31 12:00:50 +00:00
Ivo De Decker
18d951be25 Handle dependencies between excuses in a generic way
All types of dependencies between excuses (Depends, Build-Depends,
Build-Depends-Indep, ...) are handled by the same code. The DependencyType is
used to distinguish between the types where needed.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-31 11:46:10 +00:00
Ivo De Decker
12debfc7c8 Check that version increases when adding packages to testing
When we try to compute_groups for a group which has a source or a binary with
a lower version than testing, throw an exception. In the cases where this can
happen, the exception is caught. In other cases, it is not and it serves as an
assert.

This can only happen when there are multiple candidates (from multiple suites)
changing the same source or binary.

This should fix the ordering issues tested in these tests:
- tpu-unstable-binnmu
- binnmu-tpu
- tpu-with-unstable-binnmu

With this change, it should be possible to accept binNMUs from *pu again.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-17 20:08:53 +00:00
Niels Thykier
5d49a41204
Introduce a "Transaction" for changes to testing
This isolates the undo handling in the new transaction object and in
doop_source, which currently generates the undo items.  This commit
will be a stepping stone to rewriting the undo handling.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-16 19:58:02 +00:00
Niels Thykier
ced7b7b413
Refactor britney.py to use InstallabilityTester less
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-16 11:00:01 +00:00
Niels Thykier
deb9482a2f
Move parse_provides to britney2.utils
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-15 21:58:36 +00:00
Ivo De Decker
3828a76053 Filter out cruft in find_smooth_updateable_binaries
When calculating smooth updateable binaries, filter out cruft binaries from
unstable, because they will not be part of the set of packages that britney
will try to migrate to testing.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-12-11 16:18:53 +00:00
Niels Thykier
65b67e763c
Replace the use of inst_tester with new suite functionality
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:20 +00:00
Niels Thykier
0a669461ca
Separate inst_tester from universe
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-11 09:38:12 +00:00
Niels Thykier
b37575f000
Stop creating some throw-away data-structures for a method call
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-11-01 21:30:24 +00:00
Niels Thykier
7bcbcb6282
Make clone_nuninst able to fully deep clone nuninst
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-10-28 21:26:48 +00:00
Niels Thykier
6c5300d873
Unfold the suite.binaries tuple into two members
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-10-25 18:34:41 +00:00
Ivo De Decker
9c606ef533 Don't add smooth-updatable cruft to migration items
Based on patch by Niels Thykier.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2018-10-24 22:15:27 +00:00