| @@ -73,63 +73,63 @@ sub show_var($$){ | | | @@ -73,63 +73,63 @@ sub show_var($$){ |
73 | if ($value =~ /know how to make/ ) { print STDERR $value, '(', $pkgdir,')',"\n";} | | 73 | if ($value =~ /know how to make/ ) { print STDERR $value, '(', $pkgdir,')',"\n";} |
74 | return $value | | 74 | return $value |
75 | } | | 75 | } |
76 | | | 76 | |
77 | sub GenerateHash ($$) { | | 77 | sub GenerateHash ($$) { |
78 | my ($pkgsrc) = shift; | | 78 | my ($pkgsrc) = shift; |
79 | my ($prefix) = shift; | | 79 | my ($prefix) = shift; |
80 | | | 80 | |
81 | # ---------------------------------------------------------------- | | 81 | # ---------------------------------------------------------------- |
82 | my ($wanted_closure) = sub () { | | 82 | my ($wanted_closure) = sub () { |
83 | my $dir = $File::Find::dir ; | | 83 | my $dir = $File::Find::dir ; |
84 | my $fname = "$File::Find::dir/$_" ; | | 84 | my $fname = "$File::Find::dir/$_" ; |
85 | | | 85 | |
86 | # skip these directories and files ( as a files including something ) | | 86 | # skip these directories and files ( as files including something ) |
87 | if ($dir =~ m|CVS$| ) {$File::Find::prune = 1; return;} | | 87 | if ($dir =~ m|CVS$| ) {$File::Find::prune = 1; return;} |
88 | if ($dir =~ m|mk$| ) {$File::Find::prune = 1; return;} | | 88 | if ($dir =~ m|mk$| ) {$File::Find::prune = 1; return;} |
89 | if ($dir =~ m|work$| ) {$File::Find::prune = 1; return;} | | 89 | if ($dir =~ m|work$| ) {$File::Find::prune = 1; return;} |
90 | if ($dir =~ m|patches$| ) {$File::Find::prune = 1; return;} | | 90 | if ($dir =~ m|patches$| ) {$File::Find::prune = 1; return;} |
91 | if ($dir =~ m|files$| ) {$File::Find::prune = 1; return;} | | 91 | if ($dir =~ m|files$| ) {$File::Find::prune = 1; return;} |
92 | if ($dir =~ m|bootstrap$| ) {$File::Find::prune = 1; return;} | | 92 | if ($dir =~ m|bootstrap$| ) {$File::Find::prune = 1; return;} |
93 | if ($dir =~ m|pkgsrc/[^/]$| ) {$File::Find::prune = 1; return;} | | 93 | if ($dir =~ m|pkgsrc/[^/]$| ) {$File::Find::prune = 1; return;} |
94 | if ($dir =~ m|x11-links| ){$File::Find::prune = 1; return;} | | 94 | if ($dir =~ m|x11-links| ) {$File::Find::prune = 1; return;} |
95 | if ($_ =~ m|^\.\#| ) { return;} | | 95 | if ($_ =~ m|^\.\#| ) { return;} |
96 | if ($_ =~ m|~$| ) { return;} | | 96 | if ($_ =~ m|~$| ) { return;} |
97 | if ($_ =~ m|buildlink3.mk$| ) { return;} | | 97 | if ($_ =~ m|buildlink3.mk$| ) { return;} |
98 | if ($_ =~ m|builtin.mk$| ) { return;} | | 98 | if ($_ =~ m|builtin.mk$| ) { return;} |
99 | | | 99 | |
100 | my($shortname) = $fname; | | 100 | my($shortname) = $fname; |
101 | $shortname =~ s|$prefix/||; | | 101 | $shortname =~ s|$prefix/||; |
102 | my($shortdir) = $dir; | | 102 | my($shortdir) = $dir; |
103 | $shortdir =~ s|$prefix/||; | | 103 | $shortdir =~ s|$prefix/||; |
104 | | | 104 | |
105 | # pick only Makefile.* and .mk ( as a files including something ) | | 105 | # pick only Makefile.* and .mk ( as files including something ) |
106 | if ($_ =~ m|Makefile| || | | 106 | if ($_ =~ m|Makefile| || |
107 | $_ =~ m|\.mk$| ) { | | 107 | $_ =~ m|\.mk$| ) { |
108 | print STDERR __LINE__, ' ', $fname,' ', `pwd`, "\n" if $debug; | | 108 | print STDERR __LINE__, ' ', $fname,' ', `pwd`, "\n" if $debug; |
109 | open(FNAME, $fname) || print STDERR __LINE__, " Problem opening file $fname:$!\n"; | | 109 | open(FNAME, $fname) || print STDERR __LINE__, " Problem opening file $fname:$!\n"; |
110 | my ($included) = ''; | | 110 | my ($included) = ''; |
111 | while (<FNAME>){ | | 111 | while (<FNAME>){ |
112 | # now starts finding included file | | 112 | # now starts finding included file |
113 | # pick .include "../../ | | 113 | # pick .include "../../ |
114 | if ( m|^\.\s*include\s+\"\.\./\.\./(.*)\"| ) { $included = $1;} | | 114 | if ( m|^\.\s*include\s+\"\.\./\.\./(.*)\"| ) { $included = $1;} |
115 | # pick ".include "Makefile" etc (without leading ../../), this needs to add package dir. | | 115 | # pick ".include "Makefile" etc (without leading ../../), this needs to add package dir. |
116 | if ( m|^\.\s*include\s+\"(.*)\"| ) { next;} # including the same directory stuff, doesn't matter | | 116 | if ( m|^\.\s*include\s+\"(.*)\"| ) { next;} # including the same directory stuff, doesn't matter |
117 | if ( m|^\.\s*include\s+\"(.*)\"| ) { $included = $prefix .'/'. $1;} | | 117 | if ( m|^\.\s*include\s+\"(.*)\"| ) { $included = $prefix .'/'. $1;} |
118 | if ( $included =~ m|/mk/| ) { next;} # it is include line but for mk, skip this line | | 118 | if ( $included =~ m|/mk/| ) { next;} # it is include line but for mk, skip this line |
119 | if ( $included =~ m|version.mk| ) { next;} | | 119 | if ( $included =~ m|version.mk| ) { next;} |
120 | if ( $included =~ m|tests/| ) { next;} | | 120 | if ( $included =~ m|tests/| ) { next;} |
121 | if ( $included =~ m|options.mk| ) { next;} | | 121 | if ( $included =~ m|options.mk| ) { next;} |
122 | if ( $included =~ m|enigmail.mk| ) { next;} | | 122 | if ( $included =~ m|enigmail.mk| ) { next;} |
123 | | | 123 | |
124 | $included =~ s,\${.CURDIR},$shortname,; | | 124 | $included =~ s,\${.CURDIR},$shortname,; |
125 | if ($included =~ /\${([^}]+)}/ ) { | | 125 | if ($included =~ /\${([^}]+)}/ ) { |
126 | my($varname) = $1; | | 126 | my($varname) = $1; |
127 | my($value) = show_var($varname, $shortdir); | | 127 | my($value) = show_var($varname, $shortdir); |
128 | $included =~ s/\${[^}]+}/$value/; | | 128 | $included =~ s/\${[^}]+}/$value/; |
129 | if ($value eq '') { | | 129 | if ($value eq '') { |
130 | print STDERR | | 130 | print STDERR |
131 | $FILE, ': ', __LINE__, ' Value ${', $varname, '} is emtpy at ', $shortdir, "\n"; | | 131 | $FILE, ': ', __LINE__, ' Value ${', $varname, '} is emtpy at ', $shortdir, "\n"; |
132 | } | | 132 | } |
133 | } | | 133 | } |
134 | print STDERR __LINE__ , ' ', $shortname, ' -> ', $included,': ',$_ ,"\n" if $debug; | | 134 | print STDERR __LINE__ , ' ', $shortname, ' -> ', $included,': ',$_ ,"\n" if $debug; |
135 | if ( $included eq '') { next;} # not include line, look at next line | | 135 | if ( $included eq '') { next;} # not include line, look at next line |