diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-07-07 02:22:51 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-07-07 02:22:51 +0000 |
commit | 21b450db6ee72bd5e6800cda2a21f00a30460fa8 (patch) | |
tree | e921ffd111526d1f0bc52c12de44aa89cfa06101 | |
parent | 13de91fbb60952073cf1d070fb1692d968d8d9b1 (diff) | |
download | drakx-21b450db6ee72bd5e6800cda2a21f00a30460fa8.tar drakx-21b450db6ee72bd5e6800cda2a21f00a30460fa8.tar.gz drakx-21b450db6ee72bd5e6800cda2a21f00a30460fa8.tar.bz2 drakx-21b450db6ee72bd5e6800cda2a21f00a30460fa8.tar.xz drakx-21b450db6ee72bd5e6800cda2a21f00a30460fa8.zip |
- 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
-rw-r--r-- | perl-install/modules.pm | 36 |
1 files changed, 17 insertions, 19 deletions
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; } #-############################################################################### |