summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-10-13 15:50:20 +0000
committerThierry Vignaud <tv@mandriva.org>2009-10-13 15:50:20 +0000
commita961efea16a43cfead232052cec901ad7a464c6b (patch)
treed47b08095688d1bec84c110beb85ab8c9a29af6b
parent211f75341248ecf991d6f81a5e6e4f1cf0813f38 (diff)
downloadurpmi-a961efea16a43cfead232052cec901ad7a464c6b.tar
urpmi-a961efea16a43cfead232052cec901ad7a464c6b.tar.gz
urpmi-a961efea16a43cfead232052cec901ad7a464c6b.tar.bz2
urpmi-a961efea16a43cfead232052cec901ad7a464c6b.tar.xz
urpmi-a961efea16a43cfead232052cec901ad7a464c6b.zip
(_all_unrequested_orphans,_kernel_callback) fix commit ignoring kernel
packages explicitely installed (aka not in /var/lib/rpm/installed-through-deps.list) (#53425) which r261072 by pterjan on 2009-09-28 tried to do now kernel orphans are handled again
-rw-r--r--urpm/orphans.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/urpm/orphans.pm b/urpm/orphans.pm
index 6c8ffd61..b53392e8 100644
--- a/urpm/orphans.pm
+++ b/urpm/orphans.pm
@@ -312,7 +312,7 @@ sub _get_current_kernel_package() {
#
my (@requested_kernels, %kernels);
sub _kernel_callback {
- my ($pkg, %l) = @_;
+ my ($pkg, $unreq_list) = @_;
my $shortname = $pkg->name;
my $n = $pkg->fullname;
@@ -323,7 +323,7 @@ sub _kernel_callback {
return if $shortname =~ /-(?:source|doc|headers|firmware(?:|-extra))$/;
# ignore requested kernels (aka that are not in /var/lib/rpm/installed-through-deps.list)
- return unless $l{$shortname};
+ return if !$unreq_list->{$shortname} && $shortname !~ /latest/;
# keep track of latest kernels in order not to try removing requested kernels:
if ($n =~ /latest/) {
@@ -354,12 +354,13 @@ sub _all_unrequested_orphans {
$l{$pkg->name} = $pkg;
push @{$provides{$_}}, $pkg foreach $pkg->provides_nosense;
}
+ my $unreq_list = unrequested_list();
my $current_kernel = _get_current_kernel_package();
while (my $pkg = shift @$req) {
# do not do anything regarding kernels if we failed to detect the running one (ie: chroot)
- _kernel_callback($pkg, %l) if $current_kernel;
+ _kernel_callback($pkg, $unreq_list) if $current_kernel;
foreach my $prop ($pkg->requires, $pkg->suggests) {
my $n = URPM::property2name($prop);
foreach my $p (@{$provides{$n} || []}) {