Ticket #138: 0004-Trivial-perl.req-cleanups.patch
| File 0004-Trivial-perl.req-cleanups.patch, 3.0 kB (added by scop, 2 years ago) |
|---|
-
a/scripts/perl.req
old new 19 19 20 20 # a simple makedepend like script for perl. 21 21 22 # To save development time I do not parse the perl gramm mar but22 # To save development time I do not parse the perl grammar but 23 23 # instead just lex it looking for what I want. I take special care to 24 24 # ignore comments and pod's. 25 25 … … 54 54 } 55 55 56 56 57 foreach $perlver (sort keys %perlreq) { 58 print "perl >= $perlver\n"; 59 } 57 60 foreach $module (sort keys %require) { 58 61 if (length($require{$module}) == 0) { 59 62 print "perl($module)\n"; … … 151 154 \s*([.0-9]*) 152 155 /x) 153 156 ) { 154 my ($whitespace, $statement, $module, $version) = ($1, $2, $3, $4);157 my ($whitespace, $statement, $module, $version) = ($1, $2, $3, $4); 155 158 156 159 # we only consider require statements that are flush against 157 160 # the left edge. any other require statements give too many … … 169 172 # skip if the phrase was "use of" -- shows up in gimp-perl, et al. 170 173 next if $module eq 'of'; 171 174 172 # if the module ends in a comma we proba ly caught some175 # if the module ends in a comma we probably caught some 173 176 # documentation of the form 'check stuff,\n do stuff, clean 174 177 # stuff.' there are several of these in the perl distribution 175 178 … … 181 184 182 185 # ($module =~ m/^\./) && next; 183 186 184 # if the module ends with .pm strip it to leave only basename. 185 # starts with /, which means its an absolute path to a file 187 # if the module starts with /, it is an absolute path to a file 186 188 if ($module =~ m(^/)) { 187 189 print "$module\n"; 188 190 next; … … 193 195 $module =~ s/qw.*$//; 194 196 $module =~ s/\(.*$//; 195 197 198 # if the module ends with .pm, strip it to leave only basename. 196 199 $module =~ s/\.pm$//; 197 200 198 201 # some perl programmers write 'require URI/URL;' when … … 211 214 212 215 my $ver = $1; 213 216 if ($ver =~ /5.00/) { 214 print "perl >= 0:$ver\n";217 $perlreq{"0:$ver"} = 1; 215 218 next; 216 219 } 217 220 else { 218 print "perl >= 1:$ver\n";221 $perlreq{"1:$ver"} = 1; 219 222 next; 220 223 } 221 224 … … 237 240 ($module =~ m/\.ph$/) && next; 238 241 239 242 $require{$module} = $version; 240 $line{$module} = $_;241 243 } 242 244 243 245 }

