summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-02-13 17:16:52 +0000
committerThierry Vignaud <tv@mandriva.org>2009-02-13 17:16:52 +0000
commitecaeffa8d14553aec3069c51e6b3c88b3a883511 (patch)
treee8e23979aa04ee7406c891f5556d2c52112a57ba /perl-install
parentfe58087f66140d4b6f109d65392c36b9fd21becd (diff)
downloaddrakx-ecaeffa8d14553aec3069c51e6b3c88b3a883511.tar
drakx-ecaeffa8d14553aec3069c51e6b3c88b3a883511.tar.gz
drakx-ecaeffa8d14553aec3069c51e6b3c88b3a883511.tar.bz2
drakx-ecaeffa8d14553aec3069c51e6b3c88b3a883511.tar.xz
drakx-ecaeffa8d14553aec3069c51e6b3c88b3a883511.zip
(remove_package_for_upgrade) split it out of setPackages()
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install/any.pm59
1 files changed, 33 insertions, 26 deletions
diff --git a/perl-install/install/any.pm b/perl-install/install/any.pm
index 9b8d4121d..a3a59d265 100644
--- a/perl-install/install/any.pm
+++ b/perl-install/install/any.pm
@@ -329,22 +329,7 @@ sub setPackages {
install::pkgs::selectPackagesAlreadyInstalled($o->{packages});
}
- if (my $extension = $o->{upgrade_by_removing_pkgs_matching}) {
- my $time = time();
- my ($_w, $wait_message) = $o->wait_message_with_progress_bar;
- $wait_message->(N("Removing packages prior to upgrade..."));
- my ($current, $total);
- my $callback = sub {
- my (undef, $type, $_id, $subtype, $amount) = @_;
- if ($type eq 'user') {
- ($current, $total) = (0, $amount);
- } elsif ($type eq 'uninst' && $subtype eq 'stop') {
- $wait_message->('', $current++, $total);
- }
- };
- push @{$o->{default_packages}}, install::pkgs::upgrade_by_removing_pkgs($o->{packages}, $callback, $extension, $o->{isUpgrade});
- log::l("Removing packages took: ", formatTimeRaw(time() - $time));
- }
+ remove_package_for_upgrade($o);
mark_skipped_packages($o);
@@ -385,23 +370,45 @@ sub setPackages {
}
}
+sub remove_package_for_upgrade {
+ my ($o) = @_;
+ my $extension;
+
+ return if !$extension = $o->{upgrade_by_removing_pkgs_matching};
+
+ my $time = time();
+ my ($_w, $wait_message) = $o->wait_message_with_progress_bar;
+ $wait_message->(N("Removing packages prior to upgrade..."));
+ my ($current, $total);
+ my $callback = sub {
+ my (undef, $type, $_id, $subtype, $amount) = @_;
+ if ($type eq 'user') {
+ ($current, $total) = (0, $amount);
+ } elsif ($type eq 'uninst' && $subtype eq 'stop') {
+ $wait_message->('', $current++, $total);
+ }
+ };
+ push @{$o->{default_packages}}, install::pkgs::upgrade_by_removing_pkgs($o->{packages}, $callback, $extension, $o->{isUpgrade});
+ log::l("Removing packages took: ", formatTimeRaw(time() - $time));
+}
+
sub upgrade_kde3_to_kde4 {
my ($o) = @_;
- if (-e "$::prefix/usr/bin/kicker"
- && !install::pkgs::packageByName($o->{packages}, 'task-kde3')) {
- log::l("kde3 installed, but task-kde3 not available so can't upgrade correctly");
+ if (-e "$::prefix/usr/bin/kicker"
+ && !install::pkgs::packageByName($o->{packages}, 'task-kde3')) {
+ log::l("kde3 installed, but task-kde3 not available so can't upgrade correctly");
- my $choice;
- $o->ask_from_({ messages => formatAlaTeX(N("You have decided to upgrade your system to %s. KDE 3.5 has been detected
+ my $choice;
+ $o->ask_from_({ messages => formatAlaTeX(N("You have decided to upgrade your system to %s. KDE 3.5 has been detected
on your system. This installer cannot preserve KDE 3.5 in an upgrade. If you choose to proceed,
KDE 4 will replace KDE 3, and you will lose your personal KDE configuration settings.
To upgrade with KDE 3.5 and your personal settings preserved,
please reboot your system and upgrade using the Mandriva update applet.", 'Mandriva Linux 2009')) },
- [ { val => \$choice, type => 'list', list => [ N_("Reboot"), N_("Proceed") ], format => \&translate } ]);
- $choice eq 'Reboot' and install::steps::rebootNeeded($o);
- log::l("ok, continuing anyway, but forcing install of task-kde4");
- install::pkgs::select_by_package_names($o->{packages}, ['task-kde4']);
- }
+ [ { val => \$choice, type => 'list', list => [ N_("Reboot"), N_("Proceed") ], format => \&translate } ]);
+ $choice eq 'Reboot' and install::steps::rebootNeeded($o);
+ log::l("ok, continuing anyway, but forcing install of task-kde4");
+ install::pkgs::select_by_package_names($o->{packages}, ['task-kde4']);
+ }
}
sub count_files {