27 Commits

Author SHA1 Message Date
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
7fdbfcbeb2 Check version of cruft removal item
If the cruft removal item has a different version than the binary currently in
testing, then the cruft item was replaced since it was added, or it was added
in error. In this case, the item should not be processed.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-09-02 22:21:52 +00:00
Ivo De Decker
e3af8993be compute_groups: rename badly named source_name
When the item is a cruft removal item, the variable contains the binary name,
not the source name. So rename it to item_package and set source_name, to the
source in both cases.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-09-02 19:51:03 +00:00
Niels Thykier
2c9e0b9b97
do_all: Prune cruft after non-recursive hints (e.g. "easy")
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-21 20:48:14 +00:00
Niels Thykier
c30ecbb7e8
Skip cruft on source migration / removal items
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-21 20:35:02 +00:00
Niels Thykier
73791e48d0
Rename migrate_item{,s}_to_target_suite
It accepts multiple items, so using a singular "item" seems like a
misfeature.

Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-21 20:35:01 +00:00
Niels Thykier
5d408fa800
Remove new cruft items in iter_packages
Signed-off-by: Niels Thykier <niels@thykier.net>
2019-01-21 20:34:59 +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
37a173af67 Always create a new SourcePackage
When an item is migrated to the target suite, always create a new
SourcePackage object with a separate binaries list (independent from the list
in the source suite). That list is updated for every binary that is added,
updated or removed. This should ensure consistent source package information
in the target suite.

The undo code doesn't need to be updated for this, because the old
SourcePackage object is put back on undo, with the old binary list.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-14 13:19:05 +00:00
Ivo De Decker
7bba77726b Always define source_t in apply_item_to_target_suite
Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-14 13:19:05 +00:00
Ivo De Decker
69c94caa01 Add source_name return value to compute_groups
When the item is a single binary cruft removal, the source name is different
from the package. compute_groups has this info anyway, so just pass it on as a
returm value.

Signed-off-by: Ivo De Decker <ivodd@debian.org>
2019-01-14 13:19:05 +00:00
Niels Thykier
179faeb23b
Update some comments to match a renamed method
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-22 21:14:33 +00:00
Niels Thykier
7d758760d1
MigrationManager: _transaction is a stack; not a queue
Correct the return value of current_transaction that treated the
_transaction field incorrectly as a queue rather than a stack like
everything else.  This completely broke the ability to commit and
rollback child transactions (correctly).  Fortunately, it could only
trigger on a "hint"-hint.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-22 20:50:06 +00:00
Niels Thykier
a5352d353b
Simplify undo code handling sources
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-20 20:29:02 +00:00
Niels Thykier
59ae7e3d68
Optimize out "nvirtual" member of undo items
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-20 20:29:01 +00:00
Niels Thykier
5642a90449
Rename _compute_groups to compute_groups
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-20 20:29:00 +00:00
Niels Thykier
33ba41c76e
Split out a _compute_removals from _compute_groups
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-20 20:28:59 +00:00
Niels Thykier
d3b391aed1
MigrationManager: Precompute a set of all architectures
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-20 19:41:46 +00:00
Niels Thykier
89fcccba13
MigrationManager: Create a is_nuninst_worse
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-20 19:41:45 +00:00
Niels Thykier
aa6dd4a0f3
Extract a compute eqv_set function
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-20 19:41:44 +00:00
Niels Thykier
a95565c0e8
Split migrate_item_to_target_suite into two
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-19 07:02:30 +00:00
Niels Thykier
57ded55674
Remove dead assignment
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 22:15:01 +00:00
Niels Thykier
c7dbd95c0b
Have MigrationManager keep track of active transaction
This leaves callers with only having to track the transaction they
need to care about (if any).

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 22:08:20 +00:00
Niels Thykier
4803065e1a
Move (and rename) try_migration to the MigrationManager
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 21:57:12 +00:00
Niels Thykier
28c7a052fa
Move to MM and rename doop_source to apply_item_to_target_suite
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 21:55:12 +00:00
Niels Thykier
4ae6a34a27
Move _compute_groups to a new MigrationManager class
Other migration methods are expected to follow in future commits.

Signed-off-by: Niels Thykier <niels@thykier.net>
2018-12-18 21:55:11 +00:00