summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2022-07-27 17:44:59 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2022-12-10 14:15:07 +0100
commit7a7c616d0add53a98641410376588fca509524a6 (patch)
tree2c8d4dee8423b8eded7ba3c9874e5ab90b9d6dc2 /urpm
parenta4e05db225d23352effb66ffbc166573a2643ea0 (diff)
downloadurpmi-7a7c616d0add53a98641410376588fca509524a6.tar
urpmi-7a7c616d0add53a98641410376588fca509524a6.tar.gz
urpmi-7a7c616d0add53a98641410376588fca509524a6.tar.bz2
urpmi-7a7c616d0add53a98641410376588fca509524a6.tar.xz
urpmi-7a7c616d0add53a98641410376588fca509524a6.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
Diffstat (limited to 'urpm')
-rw-r--r--urpm/orphans.pm12
1 files changed, 11 insertions, 1 deletions
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: