summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Chaumette <dchaumette@mandriva.com>2004-02-04 15:45:01 +0000
committerDamien Chaumette <dchaumette@mandriva.com>2004-02-04 15:45:01 +0000
commitcf9f343cafead0e447f174f5bfab5b1ee8893839 (patch)
treebf74ebb1e0b6eb5d85e67fbf05ecd253f042ca96
parentcbcbec48e838d6b5b44baf9a253b8a0f4c7cf93f (diff)
downloaddrakx-backup-do-not-use-cf9f343cafead0e447f174f5bfab5b1ee8893839.tar
drakx-backup-do-not-use-cf9f343cafead0e447f174f5bfab5b1ee8893839.tar.gz
drakx-backup-do-not-use-cf9f343cafead0e447f174f5bfab5b1ee8893839.tar.bz2
drakx-backup-do-not-use-cf9f343cafead0e447f174f5bfab5b1ee8893839.tar.xz
drakx-backup-do-not-use-cf9f343cafead0e447f174f5bfab5b1ee8893839.zip
- add network::ethernet::get_eth_cards_names
- kill duplicated code
-rw-r--r--perl-install/network/ethernet.pm10
-rw-r--r--perl-install/network/netconnect.pm6
-rwxr-xr-xperl-install/standalone/drakconnect7
3 files changed, 12 insertions, 11 deletions
diff --git a/perl-install/network/ethernet.pm b/perl-install/network/ethernet.pm
index 5ac1a3110..1fd52e06d 100644
--- a/perl-install/network/ethernet.pm
+++ b/perl-install/network/ethernet.pm
@@ -62,6 +62,16 @@ sub get_eth_cards() {
} @all_cards;
}
+sub get_eth_cards_names {
+ my (@all_cards) = @_;
+
+ foreach my $card (@all_cards) {
+ modules::remove_alias($card->[1]);
+ modules::add_alias($card->[0], $card->[1]);
+ }
+
+ { map { $_->[0] => join(': ', $_->[0], $_->[2]) } @all_cards };
+}
#- conf_network_card_backend : configure the network cards and return the list of them, or configure one specified interface : WARNING, you have to setup the ethernet cards, by calling load_category($in, 'network/main|gigabit|usb', !$::expert, 1) or load_category_backend before calling this function. Basically, you call this function in 2 times.
#- input
diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm
index 12b41a8f4..a409f875e 100644
--- a/perl-install/network/netconnect.pm
+++ b/perl-install/network/netconnect.pm
@@ -134,11 +134,7 @@ sub get_subwizard {
detect($netc->{autodetect}, 'lan');
modules::interactive::load_category($in, 'network/main|gigabit|pcmcia|usb|wireless', !$::expert, 1);
@all_cards = network::ethernet::get_eth_cards();
- foreach my $card (@all_cards) {
- modules::remove_alias($card->[1]);
- modules::add_alias($card->[0], $card->[1]);
- }
- %eth_intf = map { $_->[0] => join(': ', $_->[0], $_->[2]) } @all_cards;
+ %eth_intf = network::ethernet::get_eth_cards_names(@all_cards);
if ($is_wireless) {
require list_modules;
my @wmodules = list_modules::category2modules('network/wireless');
diff --git a/perl-install/standalone/drakconnect b/perl-install/standalone/drakconnect
index 2551b0240..61ae5fa8d 100755
--- a/perl-install/standalone/drakconnect
+++ b/perl-install/standalone/drakconnect
@@ -196,13 +196,8 @@ sub manage {
my $config = {};
eval(cat_('/etc/sysconfig/drakconnect'));
- #- duplicated from network::ethernet, to be factorized
@all_cards = network::ethernet::get_eth_cards();
- foreach my $card (@all_cards) {
- modules::remove_alias($card->[1]);
- modules::add_alias($card->[0], $card->[1]);
- }
- my %name = map { $_->[0] => join(': ', $_->[0], $_->[2]) } @all_cards;
+ my %name = network::ethernet::get_eth_cards_names(@all_cards);
$window->{rwindow}->add(gtkpack_(Gtk2::VBox->new,
0, $interface_menu = gtksignal_connect(Gtk2::OptionMenu->new,