From 21b450db6ee72bd5e6800cda2a21f00a30460fa8 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 7 Jul 2004 02:22:51 +0000 Subject: - restrict view of %mappings_24_26 and %mappings_26_24 to modules.pm - simplify mapping_24_26(), it now takes only one module name, not a list - simplify mapping_26_24(), the special case is handled properly in %mappings_26_24 --- perl-install/modules.pm | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'perl-install') diff --git a/perl-install/modules.pm b/perl-install/modules.pm index a3d7b9b30..ca9f6a375 100644 --- a/perl-install/modules.pm +++ b/perl-install/modules.pm @@ -1,7 +1,7 @@ package modules; # $Id$ use strict; -use vars qw(%conf %mappings_24_26 %mappings_26_24); +use vars qw(%conf); use common; use detect_devices; @@ -25,28 +25,26 @@ sub category2modules_and_description { map { $_ => $modules_descriptions{$_} } category2modules($categories); } -%mappings_24_26 = ("usb-ohci" => "ohci-hcd", - "usb-uhci" => "uhci-hcd", - "uhci" => "uhci-hcd", - "printer" => "usblp", - "bcm4400" => "b44", - "3c559" => "3c359", - "3c90x" => "3c59x", - "dc395x_trm" => "dc395x"); -%mappings_26_24 = reverse %mappings_24_26; +my %mappings_24_26 = ( + "usb-ohci" => "ohci-hcd", + "usb-uhci" => "uhci-hcd", + "uhci" => "uhci-hcd", + "printer" => "usblp", + "bcm4400" => "b44", + "3c559" => "3c359", + "3c90x" => "3c59x", + "dc395x_trm" => "dc395x", +); +my %mappings_26_24 = reverse %mappings_24_26; +$mappings_26_24{'uhci-hdc'} = 'usb-uhci'; + sub mapping_24_26 { - return map { c::kernel_version() =~ /^\Q2.6/ ? $mappings_24_26{$_} || $_ : $_ } @_; + my ($modname) = @_; + c::kernel_version() =~ /^\Q2.6/ && $mappings_24_26{$modname} || $modname; } sub mapping_26_24 { my ($modname) = @_; - if (c::kernel_version() =~ /^\Q2.6/) { - if ($modname eq 'uhci-hcd') { - return 'usb-uhci'; - } else { - return $mappings_26_24{$modname} || $modname; - } - } - $modname; + c::kernel_version() =~ /^\Q2.6/ && $mappings_26_24{$modname} || $modname; } #-############################################################################### -- cgit v1.2.1