From a014fc51b7d8e8cbab4e2496d559b6836568b046 Mon Sep 17 00:00:00 2001 From: Damien Chaumette Date: Thu, 12 Jun 2003 15:30:23 +0000 Subject: - drop $::Expert - simplify code --- perl-install/network/ethernet.pm | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'perl-install') diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm index a5aacee2e..b809639d8 100644 --- a/perl-install/network/ethernet.pm +++ b/perl-install/network/ethernet.pm @@ -17,30 +17,16 @@ use MDK::Common::Globals "network", qw($in $prefix); sub configure_cable { my ($netcnx, $netc, $intf, $first_time) = @_; -# $::isInstall and $in->set_help('configureNetworkCable'); + $netcnx->{type} = 'cable'; - - if ($::expert) { - my @m = ( - { description => "dhcp-client", - c => 1 }, - { description => "dhcpcd", - c => 3 }, - { description => "dhcpxd", - c => 4 }, - ); - if (my $f = $in->ask_from_listf(N("Connect to the Internet"), - N("Which dhcp client do you want to use? -Default is dhcp-client."), - sub { $_[0]{description} }, - \@m)) { - $f->{c} == 3 and $netcnx->{dhcp_client} = "dhcpcd" and $in->do_pkgs->install(qw(dhcpcd)); - $f->{c} == 4 and $netcnx->{dhcp_client} = "dhcpxd" and $in->do_pkgs->install(qw(dhcpxd)); - $f->{c} == 1 and $netcnx->{dhcp_client} = "dhcp-client" and $in->do_pkgs->install(qw(dhcp-client)); - } - } else { - $in->do_pkgs->install(qw(dhcp-client)); - } + + $in->ask_from(N("Connect to the Internet"), + N("Which dhcp client do you want to use ? (default is dhcp-client)"), + [ { val => \$netcnx->{dhcp_client}, list => ["dhcp-client", "dhcpcd", "dhcpxd"] } ], + ) or return; + + $in->do_pkgs->install($netcnx->{dhcp_client}); + go_ethernet($netc, $intf, 'dhcp', '', '', $first_time); write_cnx_script($netc, "cable", qq( -- cgit v1.2.1