diff options
author | lloyd <[email protected]> | 2008-09-28 19:09:14 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-28 19:09:14 +0000 |
commit | bef0691be422ede9ae6ad51a8e3ff238110d3eb2 (patch) | |
tree | 34b2c5ff254483c0c2fd53c065d86f1e3ba5d728 | |
parent | f84a0cd99c4576106345078acfe16a980eecac6e (diff) |
Use File::Find instead of a glob, to find modinfo.txt in any directory
inside modules
-rwxr-xr-x | configure.pl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/configure.pl b/configure.pl index dc67adca3..6b331adf0 100755 --- a/configure.pl +++ b/configure.pl @@ -8,6 +8,7 @@ use Config; use Getopt::Long; use File::Spec; use File::Copy; +use File::Find; use Sys::Hostname; my $MAJOR_VERSION = 1; @@ -419,6 +420,8 @@ sub autoload_modules { foreach my $mod (sort keys %MODULES) { my %modinfo = %{ $MODULES{$mod} }; + trace("Loading $mod"); + my $realname = $modinfo{'realname'}; if(defined($$config{'modules'}{$mod})) { @@ -1358,7 +1361,20 @@ sub read_module_files { my $mod_dir = $$config{'mods-dir'}; my %allinfo; - foreach my $modfile (glob("modules/*/*/modinfo.txt")) { + + my @modinfos; + + File::Find::find( + { wanted => sub + { if(-f $_ && /^modinfo\.txt\z/s) { + my $name = $File::Find::name; + push @modinfos, $name; + } + } + }, + $mod_dir); + + foreach my $modfile (@modinfos) { trace("reading $modfile"); my ($volume,$dirs,$file) = File::Spec->splitpath($modfile); |