summaryrefslogtreecommitdiffstats
path: root/perl-install/network
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-07-30 12:45:50 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-07-30 12:45:50 +0000
commit9f06fce8d4b6a9bc1d15563a06e80a43cbc756ef (patch)
tree543a57e634aaa0a8ba9f91e7a34caf202304db44 /perl-install/network
parenta39497eea7ae558239d2abbc3008521fcb8d0afc (diff)
downloaddrakx-9f06fce8d4b6a9bc1d15563a06e80a43cbc756ef.tar
drakx-9f06fce8d4b6a9bc1d15563a06e80a43cbc756ef.tar.gz
drakx-9f06fce8d4b6a9bc1d15563a06e80a43cbc756ef.tar.bz2
drakx-9f06fce8d4b6a9bc1d15563a06e80a43cbc756ef.tar.xz
drakx-9f06fce8d4b6a9bc1d15563a06e80a43cbc756ef.zip
cleanup (especially ensure $interface is not something like "eth0 (using
module ...)" but only "eth0" (cf network/network.pm 1.130 nasty change)
Diffstat (limited to 'perl-install/network')
-rw-r--r--perl-install/network/ethernet.pm22
1 files changed, 10 insertions, 12 deletions
diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm
index 0f9a551fb..94a727a0f 100644
--- a/perl-install/network/ethernet.pm
+++ b/perl-install/network/ethernet.pm
@@ -64,20 +64,18 @@ sub conf_network_card {
my ($netc, $intf, $type, $ipadr, $o_netadr) = @_;
#-type =static or dhcp
modules::interactive::load_category($in, 'network/main|gigabit|usb', !$::expert, 1);
- my @all_cards = conf_network_card_backend($netc, $intf, $type, undef, $ipadr, $o_netadr);
- my $interface;
- @all_cards == () and $in->ask_warn('', N("No ethernet network adapter has been detected on your system.
-I cannot set up this connection type.")) and return;
- @all_cards == 1 and $interface = $all_cards[0][0];
- while (!$interface) {
- $interface = $in->ask_from_list(N("Choose the network interface"),
+ my @all_cards = conf_network_card_backend($netc, $intf, $type, undef, $ipadr, $o_netadr) or
+ $in->ask_warn('', N("No ethernet network adapter has been detected on your system.
+I cannot set up this connection type.")), return;
+
+ my $interface = $in->ask_from_listf(N("Choose the network interface"),
N("Please choose which network adapter you want to use to connect to Internet."),
- [ map { $_->[0] . ($_->[1] ? " (using module $_->[1])" : "") } @all_cards ]
- ) or return;
- }
- $::isStandalone and modules::write_conf($prefix);
+ sub { $_->[0] . ($_->[1] ? " (using module $_->[1])" : "") },
+ \@all_cards) or return;
+
+ modules::write_conf($prefix) if $::isStandalone;
- my $_device = conf_network_card_backend($netc, $intf, $type, $interface, $ipadr, $o_netadr);
+ my $_device = conf_network_card_backend($netc, $intf, $type, $interface->[0], $ipadr, $o_netadr);
# if ( $::isStandalone and !($type eq "dhcp")) {
# $in->ask_yesorno(N("Network interface"),
# N("I'm about to restart the network device:\n") . $device . N("\nDo you agree?"), 1) and configureNetwork2($in, $prefix, $netc, $intf) and system("$prefix/sbin/ifdown $device;$prefix/sbin/ifup $device");