Ticket #139: 0005-Extract-dependencies-from-some-usual-syntaxes-of-use.patch
| File 0005-Extract-dependencies-from-some-usual-syntaxes-of-use.patch, 1.7 kB (added by scop, 2 years ago) |
|---|
-
a/scripts/perl.req
old new 136 136 } 137 137 } 138 138 139 my $modver_re = qr/[.0-9]+/; 140 139 141 if ( 140 142 141 143 # ouch could be in a eval, perhaps we do not want these since we catch … … 151 153 # quotes around name are always legal 152 154 ['"]?([^; '"\t#]*)['"]?[\t; ] 153 155 # the syntax for 'use' allows version requirements 154 \s*([.0-9]*) 156 # the latter part is for "use base qw(Foo)" and friends special case 157 \s*($modver_re|(qw\s*[(\/]\s*|['"])[^)\/"'\$]*?\s*[)\/"'])? 155 158 /x) 156 159 ) { 157 160 my ($whitespace, $statement, $module, $version) = ($1, $2, $3, $4); … … 239 242 240 243 ($module =~ m/\.ph$/) && next; 241 244 245 # use base qw(Foo) dependencies 246 if ($statement eq "use" && $module eq "base") { 247 $require{$module} = undef; 248 if ($version =~ /^qw\s*[(\/]\s*([^)\/]+?)\s*[)\/]/) { 249 $require{$_} = undef for split(' ', $1); 250 } 251 elsif ($version =~ /(["'])([^"']+)\1/) { 252 $require{$2} = undef; 253 } 254 next; 255 } 256 $version = undef unless $version =~ /^$modver_re$/o; 257 242 258 $require{$module} = $version; 243 259 } 244 260

