From 4004d5998d1c6dc034ffddfbc5aa4637d1f9cac9 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Fri, 6 Jan 2012 19:44:03 +0000 Subject: (_all_unrequested_orphans) fix reading unrequested packages list (/var/lib/rpm/installed-through-deps.list) when chrooted (was trying to read out of chroot one when computing orphans) (compute_future_unrequested_orphans,get_orphans) adapt to new calling convention --- NEWS | 1 + urpm/orphans.pm | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 2d892b71..8cef56d0 100644 --- a/NEWS +++ b/NEWS @@ -4,6 +4,7 @@ o do not compute orphan packages when handling priority upgrades o disable dudf support (we've nothing server side) o fix checking available space of mount point (mga#1342) + o fix reading unrequested packages list when chrooted Version 6.42 - 05 November 2011 diff --git a/urpm/orphans.pm b/urpm/orphans.pm index 2682f1aa..7aa6e790 100644 --- a/urpm/orphans.pm +++ b/urpm/orphans.pm @@ -355,15 +355,14 @@ sub _get_orphan_kernels() { #- #- side-effects: none sub _all_unrequested_orphans { - my ($req, $unreq) = @_; + my ($urpm, $req, $unreq) = @_; my (%l, %provides); foreach my $pkg (@$unreq) { $l{$pkg->name} = $pkg; push @{$provides{$_}}, $pkg foreach $pkg->provides_nosense; } - # (tv) FIXME: this won't work when chrooted: - my $unreq_list = unrequested_list(); + my $unreq_list = unrequested_list($urpm); my $current_kernel = _get_current_kernel_package(); @@ -413,7 +412,7 @@ sub compute_future_unrequested_orphans { my ($unreq, $req) = partition { $unrequested->{$_->name} } @pkgs; - $state->{orphans_to_remove} = _all_unrequested_orphans($req, $unreq); + $state->{orphans_to_remove} = _all_unrequested_orphans($urpm, $req, $unreq); # nb: $state->{orphans_to_remove} is used when computing ->selected_size } @@ -429,7 +428,7 @@ sub get_orphans { $urpm->{log}("computing unrequested orphans"); my ($req, $unreq) = _installed_req_and_unreq($urpm); - _all_unrequested_orphans($req, $unreq); + _all_unrequested_orphans($urpm, $req, $unreq); } sub _get_now_orphans_raw_msg { -- cgit v1.2.1