From 074de8adaf6e0d910899b7ee0f14066dcc050af7 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 29 Jul 2002 12:39:59 +0000 Subject: ensure choosing install-or-upgrade can't be done twice (since it's badly handled and hard to handle nicely) --- perl-install/install_steps_interactive.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'perl-install/install_steps_interactive.pm') diff --git a/perl-install/install_steps_interactive.pm b/perl-install/install_steps_interactive.pm index 5e12e307b..a4882f294 100644 --- a/perl-install/install_steps_interactive.pm +++ b/perl-install/install_steps_interactive.pm @@ -231,6 +231,8 @@ sub selectInstallClass1 { my ($o, $verif, $l, $def, $l2, $def2) = @_; $verif->($o->ask_from_list(_("Install Class"), _("Which installation class do you want?"), $l, $def) || die 'already displayed'); + return if !@$l2; + $::live ? 'Update' : $o->ask_from_list_(_("Install/Update"), _("Is this an install or an update?"), $l2, $def2); } @@ -253,12 +255,12 @@ sub selectInstallClass { my $verifInstallClass = sub { $::expert = $c{$_[0]} eq "expert" }; my $installMode = $o->{isUpgrade} ? $o->{keepConfiguration} ? __("Upgrade packages only") : __("Upgrade") : __("Install"); - $installMode = $o->selectInstallClass1($verifInstallClass, - first(list2kv(@c)), ${{reverse %c}}{$::expert ? "expert" : "beginner"}, - [ __("Install"), __("Upgrade"), __("Upgrade packages only") ], $installMode); - - $o->{isUpgrade} = $installMode =~ /Upgrade/; - $o->{keepConfiguration} = $installMode =~ /packages only/; + if ($installMode = $o->selectInstallClass1($verifInstallClass, + first(list2kv(@c)), ${{reverse %c}}{$::expert ? "expert" : "beginner"}, + exists $o->{isUpgrade} ? [] : [ __("Install"), __("Upgrade"), __("Upgrade packages only") ], $installMode)) { + $o->{isUpgrade} = $installMode =~ /Upgrade/; + $o->{keepConfiguration} = $installMode =~ /packages only/; + } install_steps::selectInstallClass($o); } -- cgit v1.2.1