lp:~juliank/ubuntu-release-upgrader

Get this repository:
git clone https://git.launchpad.net/~juliank/ubuntu-release-upgrader
Only Julian Andres Klode can upload to this repository. If you are Julian Andres Klode please log in for upload directions.

Branches

Name Last Modified Last Commit
improve-obsoletes 2024-04-29 10:48:33 UTC
Reimplement obsolete removal with resolve_by_keep

Author: Julian Andres Klode
Author Date: 2024-04-29 10:20:32 UTC

Reimplement obsolete removal with resolve_by_keep

Basically the idea is that we pass auto_fix=False to the cache
and then use resolve_by_keep() to revert any removals that cause
additional removals.

This is easier than it sounds however, as we need to pay special
attention to forced_obsoletes. As can be seen in the code, forced
obsoletes also remove additional dependencies (they do not check
the changes made by mark_delete() and revert it).

So we solve this with a two stage approach:

1. We mark the forced obsoletes for removal with auto_fix turned
   on. This will keep the behavior for them the same. If one of
   them can't be removed, we end up reverting it.

   For this, we need to keep the code to create and restore the
   snapshot.

2. We mark the other packages for removal without auto_fix and
   then call ProblemResolver.resolve_by_keep() to fix any broken
   packages by keeping them back.

This brings runtime from multiple seconds down to half a second
for a bare lxd container:

2024-04-29 10:34:35,549 DEBUG Start checking for obsolete pkgs
2024-04-29 10:34:35,912 DEBUG Finish checking for obsolete pkgs

It used to be over 11s before:

2024-04-29 10:28:59,382 DEBUG Start checking for obsolete pkgs
2024-04-29 10:29:11,855 DEBUG Finish checking for obsolete pkgs

LP: #1874272

11 of 1 result
This repository contains Public information 
Everyone can see this information.