From f1f68dc05ad89a16080680fabfe423758df2c35a Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Wed, 3 Oct 2007 22:13:49 +0000 Subject: merge dependencies and filenames hash in a moddeps hash --- kernel/list_modules.pm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm index e3331b0dc..e9d5d3965 100644 --- a/kernel/list_modules.pm +++ b/kernel/list_modules.pm @@ -280,27 +280,25 @@ our %l = ( }, ); -my %dependencies; -my %filenames; +my %moddeps; sub load_dependencies { my ($file) = @_; - %dependencies = (); - %filenames = (); + %moddeps = (); foreach (cat_($file)) { s![^ ]*/!!g; s!\.ko!!g; s!\.gz!!g; my ($filename, $d) = split ':'; my ($modname, @deps) = map { filename2modname($_) } $filename, split(' ', $d); - $dependencies{$modname} = \@deps; - $filenames{$modname} = $filename; + $moddeps{$modname}{deps} = \@deps; + $moddeps{$modname}{filename} = $filename; } } sub dependencies_closure { - my @l = map { dependencies_closure($_) } @{$dependencies{$_[0]} || []}; + my @l = map { dependencies_closure($_) } @{$moddeps{$_[0]}{deps} || []}; (@l, $_[0]); } @@ -316,8 +314,8 @@ sub load_default_moddeps { } sub modname2filename { - load_default_moddeps() if !%filenames; - $filenames{$_[0]}; + load_default_moddeps() if !%moddeps; + $moddeps{$_[0]}{filename}; } sub category2modules { -- cgit v1.2.1