diff options
author | Olivier Blin <oblin@mandriva.com> | 2007-08-21 12:22:39 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2007-08-21 12:22:39 +0000 |
commit | 66cd988b6e22c6c2c5b95b904c2ead12d61ba4bb (patch) | |
tree | 230948db6d70f76536fdb3c574dc632ea7ebe692 /kernel | |
parent | e865a2cfa0f16a87eb055c7ea683a04b9624cf9f (diff) | |
download | drakx-66cd988b6e22c6c2c5b95b904c2ead12d61ba4bb.tar drakx-66cd988b6e22c6c2c5b95b904c2ead12d61ba4bb.tar.gz drakx-66cd988b6e22c6c2c5b95b904c2ead12d61ba4bb.tar.bz2 drakx-66cd988b6e22c6c2c5b95b904c2ead12d61ba4bb.tar.xz drakx-66cd988b6e22c6c2c5b95b904c2ead12d61ba4bb.zip |
add a filenames hash and modname2filename()
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/list_modules.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm index 6e41aaa76..25022d95e 100644 --- a/kernel/list_modules.pm +++ b/kernel/list_modules.pm @@ -281,18 +281,22 @@ our %l = ( ); my %dependencies; +my %filenames; sub load_dependencies { my ($file) = @_; - %dependencies = map { + %dependencies = (); + %filenames = (); + 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; - } cat_($file); + $filenames{$modname} = $filename; + } } sub dependencies_closure { @@ -306,6 +310,10 @@ sub filename2modname { $modname; } +sub modname2filename { + $filenames{$_[0]}; +} + #- give module filenames, with '-' characters sub category2modules_raw { map { |