From c5d813623f86931e73b1bba1490ce20b50d7ddbe Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 27 Oct 2003 12:01:28 +0000 Subject: 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 --- perl-install/network/isdn.pm | 3 ++- perl-install/network/netconnect.pm | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'perl-install') 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'); -- cgit v1.2.1