diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-10-03 22:13:49 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-10-03 22:13:49 +0000 |
commit | f1f68dc05ad89a16080680fabfe423758df2c35a (patch) | |
tree | ed582d25c07c8188d6af57fd37d8cdf27d0248ac | |
parent | 3196a157549b12b7016648d4c5300445dad6215a (diff) | |
download | drakx-backup-do-not-use-f1f68dc05ad89a16080680fabfe423758df2c35a.tar drakx-backup-do-not-use-f1f68dc05ad89a16080680fabfe423758df2c35a.tar.gz drakx-backup-do-not-use-f1f68dc05ad89a16080680fabfe423758df2c35a.tar.bz2 drakx-backup-do-not-use-f1f68dc05ad89a16080680fabfe423758df2c35a.tar.xz drakx-backup-do-not-use-f1f68dc05ad89a16080680fabfe423758df2c35a.zip |
merge dependencies and filenames hash in a moddeps hash
-rw-r--r-- | kernel/list_modules.pm | 16 |
1 files 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 { |