summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-02-17 12:23:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-02-17 12:23:21 +0000
commit638383c19d18925c737f41f2d228758e191d3bd9 (patch)
treea062487686400a80fdd319c21af54106fe71c21f /perl-install
parent9a694f490df12a60a4c0b2d9775009ca66dc1ee0 (diff)
downloaddrakx-backup-do-not-use-638383c19d18925c737f41f2d228758e191d3bd9.tar
drakx-backup-do-not-use-638383c19d18925c737f41f2d228758e191d3bd9.tar.gz
drakx-backup-do-not-use-638383c19d18925c737f41f2d228758e191d3bd9.tar.bz2
drakx-backup-do-not-use-638383c19d18925c737f41f2d228758e191d3bd9.tar.xz
drakx-backup-do-not-use-638383c19d18925c737f41f2d228758e191d3bd9.zip
add module2description()
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/modules.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/perl-install/modules.pm b/perl-install/modules.pm
index b852c7e8e..8eba4b8d5 100644
--- a/perl-install/modules.pm
+++ b/perl-install/modules.pm
@@ -11,11 +11,17 @@ use list_modules;
%conf = ();
-sub category2modules_and_description {
- my ($categories) = @_;
+sub modules_descriptions {
my $f = '/lib/modules/' . c::kernel_version() . '/modules.description';
-e $f or $f = '/lib/modules.description';
- my %modules_descriptions = map { /(\S+)\s+(.*)/ } cat_($f);
+ map { /(\S+)\s+(.*)/ } cat_($f);
+}
+
+sub module2description { +{ modules_descriptions() }->{$_[0]} }
+
+sub category2modules_and_description {
+ my ($categories) = @_;
+ my %modules_descriptions = modules_descriptions();
map { $_ => $modules_descriptions{$_} } category2modules($categories);
}