aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-09-20 16:49:52 +0000
committerThierry Vignaud <tv@mandriva.org>2008-09-20 16:49:52 +0000
commit8489f6e3976c8c2c8da1a61627b0010de8c3363d (patch)
treec3db5468f2e87ee4a9d037dbfebf22808dfa6919 /Rpmdrake
parentfaea38fc5fc03fb27697d527484f9712e1fdbe5d (diff)
downloadrpmdrake-8489f6e3976c8c2c8da1a61627b0010de8c3363d.tar
rpmdrake-8489f6e3976c8c2c8da1a61627b0010de8c3363d.tar.gz
rpmdrake-8489f6e3976c8c2c8da1a61627b0010de8c3363d.tar.bz2
rpmdrake-8489f6e3976c8c2c8da1a61627b0010de8c3363d.tar.xz
rpmdrake-8489f6e3976c8c2c8da1a61627b0010de8c3363d.zip
(perform_installation) add basic managment of orphan packages (#43723):
- display them - handle --auto_orphans option
Diffstat (limited to 'Rpmdrake')
-rw-r--r--Rpmdrake/pkg.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm
index 08b793fd..1412c243 100644
--- a/Rpmdrake/pkg.pm
+++ b/Rpmdrake/pkg.pm
@@ -694,6 +694,15 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
$gurpm = Rpmdrake::gurpm->new(1 ? N("Please wait") : N("Package installation..."), N("Initializing..."), transient => $::main_window);
my $_gurpm_clean_guard = before_leaving { undef $gurpm };
my $something_installed;
+
+ if (@to_install && $::rpmdrake_options{auto_orphans}) {
+ urpm::orphans::compute_future_unrequested_orphans($urpm, $state);
+ if (my @orphans = map { scalar $_->fullname } @{$state->{orphans_to_remove}}) {
+ interactive_msg(N("Orphan packages"), P("The following orphan package will be removed.",
+ "The following orphan packages will be removed.", scalar(@orphans))
+ . "\n" . urpm::orphans::add_leading_spaces(join("\n", @orphans) . "\n"), scroll => 1);
+ }
+ }
my ($progress, $total, @rpms_upgrade);
my $transaction;
@@ -853,6 +862,14 @@ you may now inspect some in order to take actions:"),
statusbar_msg_remove($statusbar_msg_id); #- XXX maybe remove this
+ if ($exit_code == 0 && !$::rpmdrake_options{auto_orphans}) {
+ if (urpm::orphans::check_unrequested_orphans_after_auto_select($urpm)) {
+ if (my $msg = urpm::orphans::get_now_orphans_msg($urpm)) {
+ interactive_msg(N("Orphan packages"), $msg, scroll => 1);
+ }
+ }
+ }
+
return_with_exit_code:
return !($something_installed || scalar(@to_remove));
}