diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2003-10-27 12:01:28 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2003-10-27 12:01:28 +0000 |
commit | c5d813623f86931e73b1bba1490ce20b50d7ddbe (patch) | |
tree | dfad8340b29a9f74916d82ab6a9cef665101774e /perl-install/network | |
parent | 6d5f92a475adcd72579387c22dfc85247f94221c (diff) | |
download | drakx-c5d813623f86931e73b1bba1490ce20b50d7ddbe.tar drakx-c5d813623f86931e73b1bba1490ce20b50d7ddbe.tar.gz drakx-c5d813623f86931e73b1bba1490ce20b50d7ddbe.tar.bz2 drakx-c5d813623f86931e73b1bba1490ce20b50d7ddbe.tar.xz drakx-c5d813623f86931e73b1bba1490ce20b50d7ddbe.zip |
simplify isdn detection:
- no need to pass a ref around; if it's bound to be overwritten, just return a
new hash
- let isdn_detect only care of which fields we want for isdn stuff
Diffstat (limited to 'perl-install/network')
-rw-r--r-- | perl-install/network/isdn.pm | 3 | ||||
-rw-r--r-- | perl-install/network/netconnect.pm | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/perl-install/network/isdn.pm b/perl-install/network/isdn.pm index 2e8177b37..7ac63f15b 100644 --- a/perl-install/network/isdn.pm +++ b/perl-install/network/isdn.pm @@ -245,7 +245,7 @@ sub isdn_detect { } sub isdn_detect_backend { - my ($isdn) = @_; + my ($isdn) = { }; if (my ($c) = modules::probe_category('network/isdn')) { $isdn = { map { $_ => $c->{$_} } qw(description vendor id driver card_type type) }; $isdn->{$_} = sprintf("%0x", $isdn->{$_}) foreach 'vendor', 'id'; @@ -257,6 +257,7 @@ sub isdn_detect_backend { } $c->{options} =~ /protocol=(\d)/ and $isdn->{protocol} = $1; } + $isdn; } sub isdn_get_list() { diff --git a/perl-install/network/netconnect.pm b/perl-install/network/netconnect.pm index 399afcd92..09bc30243 100644 --- a/perl-install/network/netconnect.pm +++ b/perl-install/network/netconnect.pm @@ -16,10 +16,8 @@ my %conf; sub detect { my ($auto_detect) = @_; - my $isdn = {}; require network::isdn; - network::isdn::isdn_detect_backend($isdn); - $auto_detect->{isdn}{$_} = $isdn->{$_} foreach qw(description vendor id driver card_type type); + $auto_detect->{isdn} = network::isdn::isdn_detect_backend(); $auto_detect->{isdn}{description} =~ s/.*\|//; modules::load_category('network/main|gigabit|usb'); |