diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-05-23 18:27:07 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-05-23 18:27:07 +0000 |
commit | 0bb1667297eff25add0340af9efdaf97b2979177 (patch) | |
tree | e191d843993efb4a3227b7c092c3c5f1428fe9ad /perl-install | |
parent | 53108a4944e455be900e17b29a055c478f761e66 (diff) | |
download | drakx-0bb1667297eff25add0340af9efdaf97b2979177.tar drakx-0bb1667297eff25add0340af9efdaf97b2979177.tar.gz drakx-0bb1667297eff25add0340af9efdaf97b2979177.tar.bz2 drakx-0bb1667297eff25add0340af9efdaf97b2979177.tar.xz drakx-0bb1667297eff25add0340af9efdaf97b2979177.zip |
(init_auto_install) split it out of main()
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/install/install2.pm | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/perl-install/install/install2.pm b/perl-install/install/install2.pm index 75a2ebda6..3170d17c4 100644 --- a/perl-install/install/install2.pm +++ b/perl-install/install/install2.pm @@ -352,6 +352,31 @@ sub init_brltty() { run_program::run("brltty"); } +sub init_auto_install() { + if ($::auto_install =~ /-IP(\.pl)?$/) { + my ($ip) = cat_('/tmp/stage1.log') =~ /configuring device (?!lo)\S+ ip: (\S+)/; + my $normalized_ip = join('', map { sprintf "%02X", $_ } split('\.', $ip)); + $::auto_install =~ s/-IP(\.pl)?$/-$normalized_ip$1/; + } + require install::steps_auto_install; + eval { $o = $::o = install::any::loadO($o, $::auto_install) }; + if ($@) { + if ($o->{useless_thing_accepted}) { #- Pixel's hack to be able to fail through + log::l("error using auto_install, continuing"); + undef $::auto_install; + } else { + install::steps_auto_install_non_interactive::errorInStep($o, "Error using auto_install\n" . formatError($@)); + } + } else { + log::l("auto install config file loaded successfully"); + + #- normalize for people not using our special scheme + foreach (@{$o->{manualFstab} || []}) { + $_->{device} =~ s!^/dev/!!; + } + } +} + sub step_init { my ($o) = @_; my $o_; @@ -569,28 +594,7 @@ sub main { #- done after module dependencies are loaded for "vfat depends on fat" if ($::auto_install) { - if ($::auto_install =~ /-IP(\.pl)?$/) { - my ($ip) = cat_('/tmp/stage1.log') =~ /configuring device (?!lo)\S+ ip: (\S+)/; - my $normalized_ip = join('', map { sprintf "%02X", $_ } split('\.', $ip)); - $::auto_install =~ s/-IP(\.pl)?$/-$normalized_ip$1/; - } - require install::steps_auto_install; - eval { $o = $::o = install::any::loadO($o, $::auto_install) }; - if ($@) { - if ($o->{useless_thing_accepted}) { #- Pixel's hack to be able to fail through - log::l("error using auto_install, continuing"); - undef $::auto_install; - } else { - install::steps_auto_install_non_interactive::errorInStep($o, "Error using auto_install\n" . formatError($@)); - } - } else { - log::l("auto install config file loaded successfully"); - - #- normalize for people not using our special scheme - foreach (@{$o->{manualFstab} || []}) { - $_->{device} =~ s!^/dev/!!; - } - } + init_auto_install(); } else { $o->{interactive} ||= 'gtk'; } |