From eab5df99152da97e4ded2b3dc9882ae28e2e24ca Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 19 Nov 2004 12:22:37 +0000 Subject: - add helper functions: kernel_is_26(), module_extension() - expand code --- kernel/list_modules.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'kernel') 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; -- cgit v1.2.1