-rwxr-xr-x | scripts/makecfg.pl | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/makecfg.pl b/scripts/makecfg.pl index 20c23f5..5dd66a4 100755 --- a/scripts/makecfg.pl +++ b/scripts/makecfg.pl | |||
@@ -9,10 +9,14 @@ my $packages=""; | |||
9 | open(FILE, "<./packages"); | 9 | open(FILE, "<./packages"); |
10 | while(<FILE>){$packages.=$_;} | 10 | while(<FILE>){$packages.=$_;} |
11 | close(FILE); | 11 | close(FILE); |
12 | 12 | ||
13 | my ($dirname,$dir,$cfg,$filename,$tagname,$name,$caps,$pre,$post,$sources,@dupecheck); | 13 | my ($dirname,$dir,$file,@files,$filename,$tagname,$name,$caps,$pre,$post,$sources,@dupecheck); |
14 | $cfg = shift || die; | 14 | $file = shift || die; |
15 | push(@files, $file); | ||
16 | |||
17 | foreach(@files){ | ||
18 | my $cfg=$_; | ||
15 | ($dirname=$cfg)=~s,(.*)/(.*),$1,; | 19 | ($dirname=$cfg)=~s,(.*)/(.*),$1,; |
16 | ($filename=$cfg)=~s,(.*/)(.*),$2,; | 20 | ($filename=$cfg)=~s,(.*/)(.*),$2,; |
17 | ($tagname=$dirname)=~s,.*/,,; | 21 | ($tagname=$dirname)=~s,.*/,,; |
18 | ($caps=$tagname)=~tr/[a-z]/[A-Z]/; | 22 | ($caps=$tagname)=~tr/[a-z]/[A-Z]/; |
@@ -44,9 +48,9 @@ print $pre; | |||
44 | File::Find::find({wanted => \&wanted}, $dirname); | 48 | File::Find::find({wanted => \&wanted}, $dirname); |
45 | print $post; | 49 | print $post; |
46 | select(STDOUT); | 50 | select(STDOUT); |
47 | close(CFG); | 51 | close(CFG); |
48 | 52 | } | |
49 | exit; | 53 | exit; |
50 | 54 | ||
51 | open(FILE,">$dir/config.in"); | 55 | open(FILE,">$dir/config.in"); |
52 | select(FILE); | 56 | select(FILE); |
@@ -81,9 +85,9 @@ use vars qw/*name *dir *prune/; | |||
81 | *dir = *File::Find::dir; | 85 | *dir = *File::Find::dir; |
82 | *prune = *File::Find::prune; | 86 | *prune = *File::Find::prune; |
83 | 87 | ||
84 | sub wanted { | 88 | sub wanted { |
85 | if( /config.in/s ) { | 89 | if( /config.in$/s ) { |
86 | if(grep(/^$File::Find::dir\/config.in$/, @dupecheck)){ | 90 | if(grep(/^$File::Find::dir\/config.in$/, @dupecheck)){ |
87 | return; | 91 | return; |
88 | } | 92 | } |
89 | my $nslashes = $File::Find::dir =~ tr!/!!; | 93 | my $nslashes = $File::Find::dir =~ tr!/!!; |