From 4bb042efd8ca9b9cf5f40e66187d9708877a79a5 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 15 Oct 2003 14:23:53 +0000 Subject: drop field {next} in {steps} since it is duplicated in orderedSteps => it allows simpler modification of orderedSteps (as already done in upgrade) for mandrake move --- perl-install/install2.pm | 4 ---- perl-install/install_any.pm | 4 +--- perl-install/install_steps.pm | 2 +- perl-install/install_steps_auto_install.pm | 2 +- perl-install/steps.pm | 1 - 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/perl-install/install2.pm b/perl-install/install2.pm index cdba1e737..6bbfb514b 100644 --- a/perl-install/install2.pm +++ b/perl-install/install2.pm @@ -142,10 +142,6 @@ sub selectInstallClass { if ($o->{isUpgrade}) { $o->{keepConfiguration} and @{$o->{orderedSteps}} = grep { !/selectMouse|selectKeyboard|miscellaneous|setRootPassword|addUser|configureNetwork|installUpdates|summary|configureServices|configureX/ } @{$o->{orderedSteps}}; - my $s; foreach (@{$o->{orderedSteps}}) { - $s->{next} = $_ if $s; - $s = $o->{steps}{$_}; - } } } diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index 61a50d50f..d3b9db89b 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -193,9 +193,7 @@ sub clean_postinstall_rpms() { #- Functions #-###################################################################################### sub getNextStep() { - my ($s) = $::o->{steps}{first}; - $s = $::o->{steps}{$s}{next} while $::o->{steps}{$s}{done} || !$::o->{steps}{$s}{reachable}; - $s; + find { !$::o->{steps}{$_}{done} && $::o->{steps}{$_}{reachable} } @{$::o->{orderedSteps}} } sub spawnShell() { diff --git a/perl-install/install_steps.pm b/perl-install/install_steps.pm index 6833b3b83..9a95e2648 100644 --- a/perl-install/install_steps.pm +++ b/perl-install/install_steps.pm @@ -56,7 +56,7 @@ sub leavingStep { output(install_any::auto_inst_file(), install_any::g_auto_install(1)); } - for (my $s = $o->{steps}{first}; $s; $s = $o->{steps}{$s}{next}) { + foreach my $s (@{$o->{orderedSteps}}) { #- the reachability property must be recomputed each time to take #- into account failed step. next if $o->{steps}{$s}{done} && !$o->{steps}{$s}{redoable}; diff --git a/perl-install/install_steps_auto_install.pm b/perl-install/install_steps_auto_install.pm index e83b34267..2c89ffbad 100644 --- a/perl-install/install_steps_auto_install.pm +++ b/perl-install/install_steps_auto_install.pm @@ -25,7 +25,7 @@ sub new { @ISA = ($interactiveClass, @ISA); - for (my $f = $o->{steps}{first}; $f; $f = $o->{steps}{$f}{next}) { + foreach my $f (@{$o->{orderedSteps}}) { my $auto_name = member($f, @{$o->{interactiveSteps}}) ? 'noauto' : 'auto'; $o->{steps}{$f}{$auto_name} = 1; } diff --git a/perl-install/steps.pm b/perl-install/steps.pm index 4aa8a09a9..82eb8d8a6 100644 --- a/perl-install/steps.pm +++ b/perl-install/steps.pm @@ -34,7 +34,6 @@ use common; ); for (my $i = 0; $i < @installSteps; $i += 2) { my %h; @h{@installStepsFields} = @{ $installSteps[$i + 1] }; - $h{next} = $installSteps[$i + 2]; $h{entered} = 0; $h{onError} = $installSteps[$i + 2 * $h{onError}]; $h{reachable} = !$h{needs}; -- cgit v1.2.1