summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-12-29 12:16:30 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-12-29 12:16:30 +0000
commitbce59e8e1b55eb5ac91f30937a93aa290af40026 (patch)
treecb3f353ab8e94277f5d8efefafcbce1ba0ce686c /perl-install
parentae9b7c1acb33aacb50c8184a5588eeaf1b5b3399 (diff)
downloaddrakx-backup-do-not-use-bce59e8e1b55eb5ac91f30937a93aa290af40026.tar
drakx-backup-do-not-use-bce59e8e1b55eb5ac91f30937a93aa290af40026.tar.gz
drakx-backup-do-not-use-bce59e8e1b55eb5ac91f30937a93aa290af40026.tar.bz2
drakx-backup-do-not-use-bce59e8e1b55eb5ac91f30937a93aa290af40026.tar.xz
drakx-backup-do-not-use-bce59e8e1b55eb5ac91f30937a93aa290af40026.zip
- do not use a global $in in network::modem, pass it as a parameter
- create network::modem::ppp_configure_raw() which doesn't need $in (it is only used by network::modem::ppp_configure(), but this is clearer that way)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/network/isdn.pm2
-rw-r--r--perl-install/network/modem.pm15
-rw-r--r--perl-install/network/netconnect.pm4
3 files changed, 12 insertions, 9 deletions
diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm
index 8f7319bf9..2577fa46b 100644
--- a/perl-install/network/isdn.pm
+++ b/perl-install/network/isdn.pm
@@ -48,7 +48,7 @@ We recommand the light configuration.
$netcnx->{isdn_external}{is_light} = $netc->{autodetect}{isdn}{is_light};
$netcnx->{isdn_external}{special_command} = 'AT&F&O2B40';
require network::modem;
- network::modem::ppp_choose($netc, $netcnx->{isdn_external}) or goto isdn_step_1;
+ network::modem::ppp_choose($in, $netc, $netcnx->{isdn_external}) or goto isdn_step_1;
}
1;
}
diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm
index 3d75a5635..b277ccb56 100644
--- a/perl-install/network/modem.pm
+++ b/perl-install/network/modem.pm
@@ -6,11 +6,10 @@ use modules;
use detect_devices;
use mouse;
use network::tools;
-use MDK::Common::Globals "network", qw($in);
use Data::Dumper;
sub configure {
- my ($netcnx, $mouse, $netc, $intf) = @_;
+ my ($in, $netcnx, $mouse, $netc, $intf) = @_;
$netcnx->{type} = 'modem';
my $modem = $netcnx->{$netcnx->{type}};
# $netcnx->{$netcnx->{type}} = {};
@@ -33,7 +32,7 @@ sub configure {
last;
}
}
- ppp_choose($netc, $modem, $mouse) or return;
+ ppp_choose($in, $netc, $modem, $mouse) or return;
write_cnx_script($netc, "modem",
q(
/sbin/route del default
@@ -49,9 +48,13 @@ killall pppd
sub ppp_configure {
my ($in, $modem) = @_;
$modem or return;
+ $in->do_pkgs->install('ppp') if !$::testing;
+ ppp_configure_raw($modem);
+}
+sub ppp_configure_raw {
+ my ($modem) = @_;
any::devfssymlinkf($modem, 'modem') if $modem->{device} ne "/dev/modem";
- $in->do_pkgs->install('ppp') if !$::testing;
my %toreplace;
$toreplace{$_} = $modem->{$_} foreach qw(connection phone login passwd auth domain dns1 dns2);
@@ -211,7 +214,7 @@ END
}
sub ppp_choose {
- my ($netc, $modem, $mouse) = @_;
+ my ($in, $netc, $modem, $mouse) = @_;
$mouse ||= {};
$mouse->{device} ||= readlink "$::prefix/dev/mouse";
@@ -244,7 +247,7 @@ sub ppp_choose {
#- TODO: add choice between hcf/hsf
sub winmodemConfigure {
- my ($netc) = @_;
+ my ($in, $netc) = @_;
my $type;
foreach (keys %{$netc->{autodetect}{winmodem}}) {
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index 32a3c17c3..319e223ea 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -199,8 +199,8 @@ If you don't want to use the auto detection, deselect the checkbox.
}
) or goto step_1;
load_conf($netcnx, $netc, $intf);
- $conf{modem} and do { pre_func("modem"); require network::modem; network::modem::configure($netcnx, $mouse, $netc, $intf) or goto step_2 };
- $conf{winmodem} and do { pre_func("winmodem"); require network::modem; network::modem::winmodemConfigure($netc) or goto step_2 };
+ $conf{modem} and do { pre_func("modem"); require network::modem; network::modem::configure($in, $netcnx, $mouse, $netc, $intf) or goto step_2 };
+ $conf{winmodem} and do { pre_func("winmodem"); require network::modem; network::modem::winmodemConfigure($in, $netc) or goto step_2 };
$conf{isdn} and do { pre_func("isdn"); require network::isdn; network::isdn::configure($netcnx, $netc, $isdn) or goto step_2 };
$conf{adsl} and do { pre_func("adsl"); require network::adsl; network::adsl::configure($netcnx, $netc, $intf, $first_time) or goto step_2 };
$conf{cable} and do { pre_func("cable"); require network::ethernet; network::ethernet::configure_cable($netcnx, $netc, $intf, $first_time) or goto step_2; $netconnect::need_restart_network = 1 };