From 67d56cfa0933862ef8c9330a3a0da873c9188a79 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 2 Sep 2005 09:06:43 +0000 Subject: hoist things in install_any --- perl-install/install_any.pm | 10 +++++++++- perl-install/install_steps.pm | 4 +--- perl-install/install_steps_interactive.pm | 10 +--------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index cf4030cce..cf26dba25 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -636,7 +636,7 @@ sub load_rate_files { } sub setPackages { - my ($o) = @_; + my ($o, $wait_message) = @_; require pkgs; if (!$o->{packages} || is_empty_array_ref($o->{packages}{depslist})) { @@ -674,6 +674,14 @@ sub setPackages { #- open rpm db (always without rebuilding db, it should be false at this point). $o->{packages}{rpmdb} ||= pkgs::rpmDbOpen(); } + + $wait_message->(N("Looking at packages already installed...")); + pkgs::selectPackagesAlreadyInstalled($o->{packages}); + + if ($o->{isUpgrade}) { + $wait_message->(N("Finding packages to upgrade...")); + pkgs::selectPackagesToUpgrade($o->{packages}); + } } sub count_files { diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index e930e6d85..cbcb936cd 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -297,9 +297,7 @@ sub formatMountPartitions { sub setPackages { my ($o) = @_; - install_any::setPackages($o); - pkgs::selectPackagesAlreadyInstalled($o->{packages}); - pkgs::selectPackagesToUpgrade($o->{packages}) if $o->{isUpgrade}; + install_any::setPackages($o, sub {}); } sub deselectFoundMedia { diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index a87b4caf5..cdd1cfebd 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -399,15 +399,7 @@ sub setPackages { my $w = $o->wait_message('', $o->{isUpgrade} ? N("Looking for available packages and rebuilding rpm database...") : N("Looking for available packages...")); - install_any::setPackages($o); - - $w->set(N("Looking at packages already installed...")); - pkgs::selectPackagesAlreadyInstalled($o->{packages}); - - if ($o->{isUpgrade}) { - $w->set(N("Finding packages to upgrade...")); - pkgs::selectPackagesToUpgrade($o->{packages}); - } + install_any::setPackages($o, sub { $w->set(@_) }); } sub mirror2text { $crypto::mirrors{$_[0]} ? $crypto::mirrors{$_[0]}[0] . '|' . $_[0] : "-|URL" } -- cgit v1.2.1