summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorDamien Chaumette <dchaumette@mandriva.com>2003-05-06 16:21:00 +0000
committerDamien Chaumette <dchaumette@mandriva.com>2003-05-06 16:21:00 +0000
commita3a15c301aa6da987d66201f48e9735e21718ac6 (patch)
tree9d5ea003d9efd428b58398a4e5d2e363782b1423 /perl-install
parentfa077337a78c7550a7025e55092183fda8a74eca (diff)
downloaddrakx-a3a15c301aa6da987d66201f48e9735e21718ac6.tar
drakx-a3a15c301aa6da987d66201f48e9735e21718ac6.tar.gz
drakx-a3a15c301aa6da987d66201f48e9735e21718ac6.tar.bz2
drakx-a3a15c301aa6da987d66201f48e9735e21718ac6.tar.xz
drakx-a3a15c301aa6da987d66201f48e9735e21718ac6.zip
- remove sub intro
- change sub main signature - drop !$::isWizard code - perl_checker
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/netconnect.pm61
1 files changed, 14 insertions, 47 deletions
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index 702cab87d..0d8c7cac1 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -12,43 +12,7 @@ use network;
use network::tools;
use MDK::Common::Globals "network", qw($in $prefix $connect_file $disconnect_file $connect_prog);
-my %conf;
-#- intro is called only in standalone.
-sub intro {
- my ($prefix, $netcnx, $in) = @_;
- my ($netc, $mouse, $intf) = ({}, {}, {});
- my $text;
- my $connected;
- my $connect_file = "/etc/sysconfig/network-scripts/net_cnx_up";
- my $disconnect_file = "/etc/sysconfig/network-scripts/net_cnx_down";
- my $connect_prog = "/etc/sysconfig/network-scripts/net_cnx_pg";
- read_net_conf($prefix, $netcnx, $netc);
- if (!$::isWizard) {
- if (connected()) {
- $text = N("You are currently connected to the Internet.") . (-e $disconnect_file ? N("\nYou can disconnect or reconfigure your connection.") : N("\nYou can reconfigure your connection."));
- $connected = 1;
- } else {
- $text = N("You are not currently connected to the Internet.") . (-e $connect_file ? N("\nYou can connect to the Internet or reconfigure your connection.") : N("\nYou can reconfigure your connection."));
- $connected = 0;
- }
- my @l = (
- if_(!$connected && -e $connect_file, { description => N("Connect"), c => 1 }),
- if_($connected && -e $disconnect_file, { description => N("Disconnect"), c => 2 }),
- { description => N("Configure the connection"), c => 3 },
- { description => N("Cancel"), c => 4 },
- );
- my $e = $in->ask_from_listf(N("Internet connection & configuration"),
- translate($text),
- sub { $_[0]{description} },
- \@l);
- run_program::rooted($prefix, $connect_prog) if $e->{c} == 1;
- run_program::rooted($prefix, $disconnect_file) if $e->{c} == 2;
- main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0) if $e->{c} == 3;
- $in->exit(0) if $e->{c} == 4;
- } else {
- main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0);
- }
-}
+my %conf;
sub detect {
my ($auto_detect, $net_install) = @_;
@@ -115,10 +79,15 @@ sub init_globals {
}
sub main {
- my ($prefix, $netcnx, $netc, $mouse, $in, $intf, $first_time, $_direct_fr, $o_noauto) = @_;
+ my ($prefix, $netcnx, $in, $o_netc, $o_mouse, $o_intf, $o_first_time, $o_noauto) = @_;
+ my $netc = $o_netc || {};
+ my $mouse = $o_mouse || {};
+ my $intf = $o_intf || {};
+ my $first_time = $o_first_time || 0;
+
init_globals($in, $prefix);
$netc->{minus_one} = 0; #When one configure an eth in dhcp without gateway
- $::isStandalone and read_net_conf($prefix, $netcnx, $netc); # REDONDANCE with intro. FIXME
+ $::isStandalone and read_net_conf($prefix, $netcnx, $netc);
$netc->{NET_DEVICE} = $netcnx->{NET_DEVICE} if $netcnx->{NET_DEVICE}; # REDONDANCE with read_conf. FIXME
$netc->{NET_INTERFACE} = $netcnx->{NET_INTERFACE} if $netcnx->{NET_INTERFACE}; # REDONDANCE with read_conf. FIXME
network::network::read_all_conf($prefix, $netc, $intf);
@@ -255,14 +224,12 @@ The configuration will now be applied to your system.
N("After this is done, we recommend that you restart your X environment to avoid any hostname-related problems.")) :
N("Problems occured during configuration.
Test your connection via net_monitor or mcc. If your connection doesn't work, you might want to relaunch the configuration.");
- if ($::isWizard) {
- $::Wizard_no_previous = 1;
- $::Wizard_finished = 1;
- eval { $in->ask_okcancel(N("Network Configuration"), $m, 1) }; $in->exit(0) if $@ =~ /wizcancel/;
- undef $::Wizard_no_previous;
- undef $::Wizard_finished;
- } else { $::isStandalone and $in->ask_warn('', $m) }
-
+ $::Wizard_no_previous = 1;
+ $::Wizard_finished = 1;
+ eval { $in->ask_okcancel(N("Network Configuration"), $m, 1) }; $in->exit(0) if $@ =~ /wizcancel/;
+ undef $::Wizard_no_previous;
+ undef $::Wizard_finished;
+
step_5:
$network_configured or network::configureNetwork2($in, $prefix, $netc, $intf);