diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-08-08 18:26:31 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-08-08 18:26:31 +0000 |
commit | 157fe13a76e798fa8af5f79c792c704a593f6c93 (patch) | |
tree | 7dded9e6761033f09709722965d15b14ce7825bd /perl-install/network | |
parent | b4fd82d0ced6a2118a51b060d2eff8c4f179b52b (diff) | |
download | drakx-backup-do-not-use-157fe13a76e798fa8af5f79c792c704a593f6c93.tar drakx-backup-do-not-use-157fe13a76e798fa8af5f79c792c704a593f6c93.tar.gz drakx-backup-do-not-use-157fe13a76e798fa8af5f79c792c704a593f6c93.tar.bz2 drakx-backup-do-not-use-157fe13a76e798fa8af5f79c792c704a593f6c93.tar.xz drakx-backup-do-not-use-157fe13a76e798fa8af5f79c792c704a593f6c93.zip |
add interactive_pkgs stuff
Diffstat (limited to 'perl-install/network')
-rw-r--r-- | perl-install/network/adsl.pm | 8 | ||||
-rw-r--r-- | perl-install/network/ethernet.pm | 12 | ||||
-rw-r--r-- | perl-install/network/isdn.pm | 4 | ||||
-rw-r--r-- | perl-install/network/modem.pm | 4 | ||||
-rw-r--r-- | perl-install/network/netconnect.pm | 13 | ||||
-rw-r--r-- | perl-install/network/network.pm | 9 | ||||
-rw-r--r-- | perl-install/network/tools.pm | 2 |
7 files changed, 25 insertions, 27 deletions
diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm index 4e655e94b..a922585cc 100644 --- a/perl-install/network/adsl.pm +++ b/perl-install/network/adsl.pm @@ -6,7 +6,7 @@ use network::tools; use network::ethernet; use vars qw(@ISA @EXPORT); -use MDK::Common::Globals "network", qw($in $prefix $install $connect_file $disconnect_file); +use MDK::Common::Globals "network", qw($in $prefix $connect_file $disconnect_file); @ISA = qw(Exporter); @EXPORT = qw(adsl_ask_info adsl_detect adsl_conf adsl_conf_backend); @@ -21,7 +21,7 @@ Some connections use pptp, a few ones use dhcp. If you don't know, choose 'use pppoe'"), [__("use pppoe"), __("use pptp"), __("use dhcp")]) or return; $type =~ s/use //; if ($type eq 'pppoe') { - $install->("rp-$type"); + $in->do_pkgs->install("rp-$type"); $netcnx->{type} = "adsl_$type"; $netcnx->{"adsl_$type"} = {}; adsl_conf($netcnx->{"adsl_$type"}, $netc, $intf, $type) or goto conf_adsl_step1; @@ -33,11 +33,11 @@ If you don't know, choose 'use pppoe'"), [__("use pppoe"), __("use pptp"), __("u } } if ($type eq 'dhcp') { - $install->(qw(dhcpcd)); + $in->do_pkgs->install(qw(dhcpcd)); go_ethernet($netc, $intf, 'dhcp', '', '', $first_time) or goto conf_adsl_step1; } if ($type eq 'pptp') { - $install->(qw(pptp-adsl-fr)); + $in->do_pkgs->install(qw(pptp-adsl-fr)); $netcnx->{type} = "adsl_$type"; $netcnx->{"adsl_$type"} = {}; adsl_conf($netcnx->{"adsl_$type"}, $netc, $intf, $type) or goto conf_adsl_step1; diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm index 0c5a70b19..adf3388bd 100644 --- a/perl-install/network/ethernet.pm +++ b/perl-install/network/ethernet.pm @@ -8,7 +8,7 @@ use common; use run_program; use network::tools; use vars qw(@ISA @EXPORT); -use MDK::Common::Globals "network", qw($in $prefix $install); +use MDK::Common::Globals "network", qw($in $prefix); @ISA = qw(Exporter); @EXPORT = qw(configureNetwork conf_network_card conf_network_card_backend go_ethernet); @@ -38,12 +38,12 @@ sub configure_cable { Default is dhcpcd"), sub { $_[0]{description} }, \@m )) { - $f->{c}==1 and $netcnx->{dhcp_client}="dhcpcd" and $install->(qw(dhcpcd)); - $f->{c}==3 and $netcnx->{dhcp_client}="dhcpxd" and $install->(qw(dhcpxd)); - $f->{c}==4 and $netcnx->{dhcp_client}="dhcp-client" and $install->(qw(dhcp-client)); + $f->{c}==1 and $netcnx->{dhcp_client}="dhcpcd" and $in->do_pkgs->install(qw(dhcpcd)); + $f->{c}==3 and $netcnx->{dhcp_client}="dhcpxd" and $in->do_pkgs->install(qw(dhcpxd)); + $f->{c}==4 and $netcnx->{dhcp_client}="dhcp-client" and $in->do_pkgs->install(qw(dhcp-client)); } } else { - $install->(qw(dhcpcd)); + $in->do_pkgs->install(qw(dhcpcd)); } go_ethernet($netc, $intf, 'dhcp', '', '', $first_time); write_cnx_script($netc, "cable", @@ -62,7 +62,7 @@ sub configure_lan { $::isInstall and $in->set_help('configureNetworkIP'); require Data::Dumper; configureNetwork($netc, $intf, $first_time) or return; - configureNetwork2($in, $prefix, $netc, $intf, $install); + configureNetwork2($in, $prefix, $netc, $intf); if ($::isStandalone and ($::expert or $in->ask_yesorno(_("Network configuration"), _("Do you want to restart the network"), 1))) { run_program::rooted($prefix, "/etc/rc.d/init.d/network stop"); diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm index e80a625ba..24d11d7d4 100644 --- a/perl-install/network/isdn.pm +++ b/perl-install/network/isdn.pm @@ -8,7 +8,7 @@ use run_program; use log; use network::tools; use vars qw(@ISA @EXPORT); -use MDK::Common::Globals "network", qw($in $prefix $install); +use MDK::Common::Globals "network", qw($in $prefix); use MDK::Common::File; @ISA = qw(Exporter); @EXPORT = qw(isdn_write_config isdn_write_config_backend get_info_providers_backend isdn_ask_info isdn_ask_protocol isdn_ask isdn_detect isdn_detect_backend isdn_get_list isdn_get_info); @@ -59,7 +59,7 @@ We recommand the light configuration. $p && pkgs::packageFlagSelected($p) and pkgs::unselectPackage($in->{packages}, $p); } run_program::rooted($prefix, "rpm", "-e", "$rmpackage"); - $install->($instpackage, if_($isdn->{speed} =~ /128/, 'ibod'), 'isdn4k-utils'); + $in->do_pkgs->install($instpackage, if_($isdn->{speed} =~ /128/, 'ibod'), 'isdn4k-utils'); my $light = $e =~ /light/ ? 1 : 0; isdn_write_config_backend($isdn, $light, $netc); 1; diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm index 206f8dfb0..f06c60219 100644 --- a/perl-install/network/modem.pm +++ b/perl-install/network/modem.pm @@ -7,7 +7,7 @@ use detect_devices; use mouse; use network::tools; use vars qw(@ISA @EXPORT); -use MDK::Common::Globals "network", qw($in $prefix $install); +use MDK::Common::Globals "network", qw($in $prefix); @ISA = qw(Exporter); @EXPORT = qw(pppConfig modem_detect_backend); @@ -51,7 +51,7 @@ sub pppConfig { { label => _("First DNS Server (optional)"), val => \$modem->{dns1} }, { label => _("Second DNS Server (optional)"), val => \$modem->{dns2} }, ]) or return; - any::pppConfig($in, $modem, $prefix, $install); + any::pppConfig($in, $modem, $prefix); $netc->{$_}='ppp0' foreach 'NET_DEVICE', 'NET_INTERFACE'; 1; } diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index b9ac8f677..e5dff7d89 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -17,12 +17,12 @@ use commands; #require Data::Dumper; use network::tools; -use MDK::Common::Globals "network", qw($in $prefix $install $connect_file $disconnect_file $connect_prog); +use MDK::Common::Globals "network", qw($in $prefix $connect_file $disconnect_file $connect_prog); #- intro is called only in standalone. sub intro { - my ($prefix, $netcnx, $in, $install) = @_; + my ($prefix, $netcnx, $in) = @_; my ($netc, $mouse, $intf) = ({}, {}, {}); my $text; my $connected; @@ -52,9 +52,9 @@ sub intro { \@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, $install, 0, 0) if ($e->{c}==3); + main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0) if ($e->{c}==3); } else { - main($prefix, $netcnx, $netc, $mouse, $in, $intf, $install, 0, 0); + main($prefix, $netcnx, $netc, $mouse, $in, $intf, 0, 0); } } @@ -110,11 +110,10 @@ sub pre_func { } sub main { - my ($prefix, $netcnx, $netc, $mouse, $in, $intf, $install, $first_time, $direct_fr) = @_; + my ($prefix, $netcnx, $netc, $mouse, $in, $intf, $first_time, $direct_fr) = @_; MDK::Common::Globals::init( in => $in, prefix => $prefix, - install => $install, connect_file => "/etc/sysconfig/network-scripts/net_cnx_up", disconnect_file => "/etc/sysconfig/network-scripts/net_cnx_down", connect_prog => "/etc/sysconfig/network-scripts/net_cnx_pg" ); @@ -236,7 +235,7 @@ environnement to avoid hostname changing problem.")); step_5: - network::configureNetwork2($in, $prefix, $netc, $intf, $install); + network::configureNetwork2($in, $prefix, $netc, $intf); if ($netcnx->{type} =~ /modem/ || $netcnx->{type} =~ /isdn_external/) { output "$prefix$connect_prog", diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm index ecf7823c2..628b9278a 100644 --- a/perl-install/network/network.pm +++ b/perl-install/network/network.pm @@ -390,7 +390,6 @@ sub read_all_conf { #- $prefix #- $netc #- $intf -#- $install : a function that takes a list of package and install them : ex sub { system("urpmi --auto --best-output " . join(' ', @_)); } #- $netc input #- NETWORKING : networking flag : string : "yes" by default #- FORWARD_IPV4 : forward IP flag : string : "false" by default @@ -411,20 +410,20 @@ sub read_all_conf { #- $intf->{$device}{DEVICE} : DEVICE = $device #- $intf->{$device}{BOOTPROTO} : boot prototype : "bootp" or "dhcp" or "pump" or ... sub configureNetwork2 { - my ($in, $prefix, $netc, $intf, $install) = @_; + my ($in, $prefix, $netc, $intf) = @_; my $etc = "$prefix/etc"; - $netc->{wireless_eth} and $install->('wireless-tools'); + $netc->{wireless_eth} and $in->do_pkgs->install('wireless-tools'); write_conf("$etc/sysconfig/network", $netc); write_resolv_conf("$etc/resolv.conf", $netc); write_interface_conf("$etc/sysconfig/network-scripts/ifcfg-$_->{DEVICE}", $_) foreach grep { $_->{DEVICE} } values %$intf; add2hosts("$etc/hosts", $netc->{HOSTNAME}, map { $_->{IPADDR} } values %$intf); if (grep { $_->{BOOTPROTO} =~ /^(dhcp)$/ } values %$intf) { - $::isStandalone ? $in->standalone::pkgs_install('dhcpcd') : $install->('dhcpcd'); + $in->do_pkgs->install('dhcpcd'); } if (grep { $_->{BOOTPROTO} =~ /^(pump|bootp)$/ } values %$intf) { - $::isStandalone ? $in->standalone::pkgs_install('pump') : $install->('pump'); + $in->do_pkgs->install('pump'); } #-res_init(); #- reinit the resolver so DNS changes take affect diff --git a/perl-install/network/tools.pm b/perl-install/network/tools.pm index 8102c1ae3..ecd1f1974 100644 --- a/perl-install/network/tools.pm +++ b/perl-install/network/tools.pm @@ -3,7 +3,7 @@ package network::tools; use common; use run_program; use vars qw(@ISA @EXPORT); -use MDK::Common::Globals "network", qw($in $prefix $install $disconnect_file $connect_prog $connect_file $disconnect_file); +use MDK::Common::Globals "network", qw($in $prefix $disconnect_file $connect_prog $connect_file $disconnect_file); @ISA = qw(Exporter); @EXPORT = qw(write_cnx_script write_secret_backend ask_connect_now connect_backend disconnect_backend read_providers_backend ask_info2 connected disconnected); |