author | kergoth <kergoth> | 2003-01-16 04:39:25 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-01-16 04:39:25 (UTC) |
commit | 21cee2677c4a480f00675cdc9160e5d7e97e7122 (patch) (unidiff) | |
tree | a2e3b3f9675949fae2cf57e0f7b44441e7bfa06c /scripts | |
parent | 7ffd4623880396f07e34faf195f8c131218cf682 (diff) | |
download | opie-21cee2677c4a480f00675cdc9160e5d7e97e7122.zip opie-21cee2677c4a480f00675cdc9160e5d7e97e7122.tar.gz opie-21cee2677c4a480f00675cdc9160e5d7e97e7122.tar.bz2 |
*** empty log message ***
-rwxr-xr-x | scripts/deps.pl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/deps.pl b/scripts/deps.pl index feced6e..a219e36 100755 --- a/scripts/deps.pl +++ b/scripts/deps.pl | |||
@@ -1,77 +1,77 @@ | |||
1 | #!/usr/bin/perl -w | 1 | #!/usr/bin/perl -w |
2 | 2 | ||
3 | use strict; | 3 | use strict; |
4 | 4 | ||
5 | my %depends; | 5 | my %depends; |
6 | my %tokenpath; | 6 | my %tokenpath; |
7 | 7 | ||
8 | sub getdepends ($$) | 8 | sub getdepends ($$) |
9 | { | 9 | { |
10 | my ($token, $path, $intoken); | 10 | my ($token, $path, $intoken); |
11 | $token = shift || return; | 11 | $token = shift || return; |
12 | $token =~ s/CONFIG_//; | 12 | $token =~ s/CONFIG_//; |
13 | $path = shift || return; | 13 | $path = shift || return; |
14 | #print "opening $path/config.in\n"; | 14 | #print "opening $path/config.in\n"; |
15 | #print "token is $token\n"; | 15 | #print "token is $token\n"; |
16 | open( FILE, "< $path/config.in" ) || return; | 16 | open( FILE, "< $path/config.in" ) || return; |
17 | $intoken = 0; | 17 | $intoken = 0; |
18 | while( <FILE> ) { | 18 | while( <FILE> ) { |
19 | if( $intoken == 1 ) { | 19 | if( $intoken == 1 ) { |
20 | /depends\S*(.*)/ && return $1; | 20 | /depends\S*(.*)/ && return $1; |
21 | if( /\S*(config|menu)/ ) { | 21 | if( /\S*(config|menu)/ ) { |
22 | $intoken = 0; | 22 | $intoken = 0; |
23 | return; | 23 | return; |
24 | } | 24 | } |
25 | } else { | 25 | } else { |
26 | /$token/ || next; | 26 | /$token/ || next; |
27 | $intoken = 1; | 27 | $intoken = 1; |
28 | } | 28 | } |
29 | /$token/ || next; | 29 | /$token/ || next; |
30 | } | 30 | } |
31 | close( FILE ); | 31 | close( FILE ); |
32 | return; | 32 | return; |
33 | } | 33 | } |
34 | 34 | ||
35 | sub makedepends ($$) | 35 | sub makedepends ($$) |
36 | { | 36 | { |
37 | my ($depends, $tokenpath, $token, $depword, $mustbesep, $state); | 37 | my ($depends, $tokenpath, $token, $depword, $mustbesep, $state); |
38 | $depends = shift || return; | 38 | $depends = shift || return; |
39 | $tokenpath = shift || return; | 39 | $tokenpath = shift || return; |
40 | $mustbesep = 0; | 40 | $mustbesep = 0; |
41 | 41 | ||
42 | for $token (keys %$depends){ | 42 | for $token (keys %$depends){ |
43 | print ${$tokenpath}{$token} . " : "; | 43 | print ${$tokenpath}{$token} . " : "; |
44 | for (split(/\s+/, ${$depends}{$token})){ | 44 | for (split(/\s+/, ${$depends}{$token})){ |
45 | /^\s+$/ && next; | 45 | /^\s+$/ && next; |
46 | /\&\&/ && next; | 46 | /\&\&/ && next; |
47 | /\|\|/ && next; | 47 | /\|\|/ && next; |
48 | /^$/ && next; | 48 | /^$/ && next; |
49 | /^\($/ && next; | 49 | /^\($/ && next; |
50 | /^\)$/ && next; | 50 | /^\)$/ && next; |
51 | /^on$/ && next; | 51 | /^on$/ && next; |
52 | /^!$/ && next; | 52 | /^!$/ && next; |
53 | if(defined(${$tokenpath}{"CONFIG_" . $_})){ | 53 | if(defined(${$tokenpath}{"CONFIG_" . $_})){ |
54 | print '$(if $(CONFIG_' . $_ . '),' . ${$tokenpath}{"CONFIG_" . $_} . ') '; | 54 | print '$(if $(CONFIG_' . $_ . '),' . ${$tokenpath}{"CONFIG_" . $_} . ') '; |
55 | } else { | 55 | } else { |
56 | print STDERR "Warning: unable to locate path for token CONFIG_$_\n"; | 56 | # print STDERR "Warning: unable to locate path for token CONFIG_$_\n"; |
57 | } | 57 | } |
58 | } | 58 | } |
59 | print "\n"; | 59 | print "\n"; |
60 | } | 60 | } |
61 | } | 61 | } |
62 | 62 | ||
63 | while( <> ) { | 63 | while( <> ) { |
64 | my $dep; | 64 | my $dep; |
65 | my ($token, $path, $pro); | 65 | my ($token, $path, $pro); |
66 | chomp; | 66 | chomp; |
67 | s/^\s*//g; | 67 | s/^\s*//g; |
68 | s/\s*$//g; | 68 | s/\s*$//g; |
69 | ($token, $path, $pro) = split(/\s+/,$_); | 69 | ($token, $path, $pro) = split(/\s+/,$_); |
70 | $tokenpath{$token} = $path; | 70 | $tokenpath{$token} = $path; |
71 | $dep = getdepends($token, $path); | 71 | $dep = getdepends($token, $path); |
72 | if( $dep ) { | 72 | if( $dep ) { |
73 | $depends{$token} = $dep; | 73 | $depends{$token} = $dep; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | ||
77 | makedepends(\%depends, \%tokenpath); | 77 | makedepends(\%depends, \%tokenpath); |