summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-11-19 12:22:37 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-11-19 12:22:37 +0000
commiteab5df99152da97e4ded2b3dc9882ae28e2e24ca (patch)
tree7db5495b65f8f6dc2d8ebc0c0a6b7b0f5065f5ec /kernel
parentfae9c13a21426965203b0a1a37b76d51f8e5ff87 (diff)
downloaddrakx-backup-do-not-use-eab5df99152da97e4ded2b3dc9882ae28e2e24ca.tar
drakx-backup-do-not-use-eab5df99152da97e4ded2b3dc9882ae28e2e24ca.tar.gz
drakx-backup-do-not-use-eab5df99152da97e4ded2b3dc9882ae28e2e24ca.tar.bz2
drakx-backup-do-not-use-eab5df99152da97e4ded2b3dc9882ae28e2e24ca.tar.xz
drakx-backup-do-not-use-eab5df99152da97e4ded2b3dc9882ae28e2e24ca.zip
- add helper functions: kernel_is_26(), module_extension()
- expand code
Diffstat (limited to 'kernel')
-rw-r--r--kernel/list_modules.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm
index ac4334db1..487b36f2d 100644
--- a/kernel/list_modules.pm
+++ b/kernel/list_modules.pm
@@ -3,7 +3,7 @@ package list_modules;
use MDK::Common;
our @ISA = qw(Exporter);
-our @EXPORT = qw(load_dependencies dependencies_closure category2modules module2category sub_categories);
+our @EXPORT = qw(load_dependencies dependencies_closure category2modules module2category sub_categories kernel_is_26 module_extension);
# the categories have 2 purposes
# - choosing modules to include on stage1's (cf update_kernel and mdk-stage1/pci-resource/update-pci-ids.pl)
@@ -218,10 +218,11 @@ sub dependencies_closure {
sub category2modules {
map {
my ($t1, $t2s) = m|(.*)/(.*)|;
- map {
+ my @sub = $t2s eq '*' ? keys %{$l{$t1}} : split('\|', $t2s);
+ map {
my $l = $l{$t1}{$_} or die "bad category $t1/$_\n" . backtrace();
@$l;
- } $t2s eq '*' ? keys %{$l{$t1}} : split('\|', $t2s);
+ } @sub;
} split(' ', $_[0]);
}
@@ -241,4 +242,8 @@ sub sub_categories {
keys %{$l{$t1}};
}
+sub kernel_is_26 { $_[0] =~ /^2\.6/ }
+
+sub module_extension { kernel_is_26($_[0]) ? 'ko' : 'o' }
+
1;