diff options
Diffstat (limited to 'urpm/orphans.pm')
-rw-r--r-- | urpm/orphans.pm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/urpm/orphans.pm b/urpm/orphans.pm index f27bc610..cc9e76d2 100644 --- a/urpm/orphans.pm +++ b/urpm/orphans.pm @@ -443,7 +443,7 @@ so it's useless to look at them # %kernels tracks !"*-latest" kernels (to be later filtered) my (@req_by_latest_kernels, %requested_kernels, %kernels); sub _kernel_callback { - my ($pkg, $unreq_list) = @_; + my ($urpm, $pkg, $unreq_list) = @_; my $shortname = $pkg->name; my $n = $pkg->fullname; @@ -464,9 +464,11 @@ sub _kernel_callback { # keep track of packages required by latest kernels in order not to try removing requested kernels: if ($n =~ /latest/) { - push @req_by_latest_kernels, $pkg->requires; + my @a = $urpm->packages_providing($pkg->requires); + my $kpkg = $a[0]; + push @req_by_latest_kernels, scalar $kpkg->fullname if $kpkg; } else { - $kernels{$shortname} = $pkg; + $kernels{$n} = $pkg; } } @@ -498,7 +500,7 @@ sub _all_unrequested_orphans { my (%l, %provides); # 1- list explicit provides (not files) from installed packages: foreach my $pkg (@$unreq) { - $l{$pkg->name} = $pkg; + $l{$pkg->fullname} = $pkg; push @{$provides{$_}}, $pkg foreach $pkg->provides_nosense; } my $unreq_list = unrequested_list($urpm); @@ -508,12 +510,13 @@ sub _all_unrequested_orphans { # 2- check if "unrequested" packages are still needed: while (my $pkg = shift @$req) { # do not do anything regarding kernels if we failed to detect the running one (ie: chroot) - _kernel_callback($pkg, $unreq_list) if $current_kernel; + _kernel_callback($urpm, $pkg, $unreq_list) if $current_kernel; foreach my $prop ($pkg->requires, $pkg->recommends_nosense) { my $n = URPM::property2name($prop); foreach my $p (@{$provides{$n} || []}) { - if ($p != $pkg && $l{$p->name} && $p->provides_overlap($prop)) { - delete $l{$p->name}; + my $pfn = $p->fullname; + if ($p != $pkg && $l{$pfn} && $p->provides_overlap($prop)) { + delete $l{$pfn}; push @$req, $p; } } |