diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2022-07-27 17:44:59 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2023-04-13 22:13:50 +0200 |
commit | acee538d3fb370ebfb63ac0a1348ce5a44d692d7 (patch) | |
tree | 7a65af7e794fea043043883f17600cd4e8343b6a | |
parent | 0c9b00f27371e64c6ad862b583c5117099dc1f12 (diff) | |
download | urpmi-acee538d3fb370ebfb63ac0a1348ce5a44d692d7.tar urpmi-acee538d3fb370ebfb63ac0a1348ce5a44d692d7.tar.gz urpmi-acee538d3fb370ebfb63ac0a1348ce5a44d692d7.tar.bz2 urpmi-acee538d3fb370ebfb63ac0a1348ce5a44d692d7.tar.xz urpmi-acee538d3fb370ebfb63ac0a1348ce5a44d692d7.zip |
(_all_unrequested_orphans) handle mga9 kernels
Now kernel names are unversionned and we've multiple packages with the
same "kernel" name which make orphans handling to derail
-rw-r--r-- | Changes | 4 | ||||
-rw-r--r-- | urpm/orphans.pm | 12 |
2 files changed, 15 insertions, 1 deletions
@@ -1,3 +1,7 @@ +- urpmi: + o Fix --auto-orphans vs new kernel naming + (having multuple "kernel" pkgs with different versions) + Version 8.130 - 28 January 2023 - library: diff --git a/urpm/orphans.pm b/urpm/orphans.pm index a5d5cc5c..11bd555e 100644 --- a/urpm/orphans.pm +++ b/urpm/orphans.pm @@ -1,7 +1,7 @@ package urpm::orphans; use strict; -use urpm::util qw(add2hash_ append_to_file cat_ output_safe partition put_in_hash uniq wc_l); +use urpm::util qw(add2hash_ append_to_file cat_ member output_safe partition put_in_hash uniq wc_l); use urpm::msg; use urpm; @@ -519,12 +519,22 @@ sub _all_unrequested_orphans { my (%l, %provides); # 1- list explicit provides (not files) from installed packages: + + my $need_expand = 0; foreach my $pkg (@$unreq) { $l{$pkg->fullname} = $pkg; + my $n = $pkg->name; + # Instead of hardcoding desktop/linus/server/... flavors, blacklist: + $need_expand++ if $n =~ /^kernel-(\w+)$/ && !member($1, qw(doc firmware source)); push @{$provides{$_}}, $pkg foreach $pkg->provides_nosense; } my $unreq_list = unrequested_list($urpm); + # we need to replace/augment eg "kernel-desktop" by the "kernel-desktop-V-R" for each installed kernel: + if ($need_expand) { + $kernels{$_->fullname} = $_ foreach grep { /^kernel/ } @$unreq; + } + my ($current_kernel_version, $current_kernel) = _get_current_kernel_package(); # 2- check if "unrequested" packages are still needed: |