From 32edfb0586bfb529616df3ac2b4135dbdacf503f Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 10 Feb 2009 18:07:00 +0000 Subject: Handle relative paths in modules.dep --- kernel/list_modules.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/list_modules.pm b/kernel/list_modules.pm index 71b487de8..ef7fae4c5 100644 --- a/kernel/list_modules.pm +++ b/kernel/list_modules.pm @@ -288,10 +288,10 @@ our %l = ( my %moddeps; sub load_dependencies { - my ($file) = @_; + my ($file, $o_root) = @_; %moddeps = (); - foreach (cat_($file)) { + foreach (cat_($o_root . $file)) { my ($m, $d) = split ':'; my $path = $m; my ($filename, @fdeps) = map { @@ -300,9 +300,15 @@ sub load_dependencies { s!\.gz!!g; $_; } $m, split(' ', $d); + my ($modname, @deps) = map { filename2modname($_) } $filename, @fdeps; $moddeps{$modname}{deps} = \@deps; $moddeps{$modname}{filename} = $filename; + if (!begins_with($path, "/")) { + #- with newer module-init-tools, modules.dep can contain + #- relative paths + $path = dirname($file).'/'.$path; + } $moddeps{$modname}{path} = $path; } } -- cgit v1.2.1