From: Steve Hay Date: Thu, 1 Oct 2009 23:56:10 +0000 (+0100) Subject: Make installperl look in cpan/ and dist/ as well as in ext/ when looking X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19c8b1959f8e62550ec7e54c8a12efbf034555a3;p=p5sagit%2Fp5-mst-13.2.git Make installperl look in cpan/ and dist/ as well as in ext/ when looking for %archpms. Also add a trailing / after the $dir when checking whether a .pm file is that of a non-nonxs_ext module, otherwise entries in nonxs_ext for Digest and Math/BigInt wrongly cause Digest-MD5, Digest-SHA and Math-BigInt-FastCalc to be omitted. --- diff --git a/installperl b/installperl index 1705d34..38f51ea 100755 --- a/installperl +++ b/installperl @@ -156,30 +156,33 @@ if ((-e "testcompile") && (defined($ENV{'COMPILE'}))) { # Exclude nonxs extensions that are not architecture dependent my @nonxs = grep(!/^Errno$/, split(' ', $Config{'nonxs_ext'})); -find(sub { - if (($File::Find::name =~ m{^ext\b(.*)/([^/]+)\.pm$}) && - ! grep { (my $dir = $_) =~ s/\//-/g; - $File::Find::name =~ /^ext\/$dir/ } @nonxs) - { - my($path, $modname) = ($1,$2); - - # Change hypenated name like Filter-Util-Call to nested - # directory name Filter/Util/Call - $path =~ s{-}{/}g; - - # strip to optional "/lib", or remove trailing component - $path =~ s{.*/lib\b}{} or $path =~ s{/[^/]*$}{}; - - # strip any leading / - $path =~ s{^/}{}; - - # reconstitute canonical module name - $modname = "$path/$modname" if length $path; - - # remember it - $archpms{$modname} = 1; - } -}, 'ext'); +my @ext_dirs = qw(cpan dist ext); +foreach my $ext_dir (@ext_dirs) { + find(sub { + if (($File::Find::name =~ m{^$ext_dir\b(.*)/([^/]+)\.pm$}) && + ! grep { (my $dir = $_) =~ s/\//-/g; + $File::Find::name =~ /^$ext_dir\/$dir\// } @nonxs) + { + my($path, $modname) = ($1,$2); + + # Change hypenated name like Filter-Util-Call to nested + # directory name Filter/Util/Call + $path =~ s{-}{/}g; + + # strip to optional "/lib", or remove trailing component + $path =~ s{.*/lib\b}{} or $path =~ s{/[^/]*$}{}; + + # strip any leading / + $path =~ s{^/}{}; + + # reconstitute canonical module name + $modname = "$path/$modname" if length $path; + + # remember it + $archpms{$modname} = 1; + } + }, $ext_dir); +} # print "[$_]\n" for sort keys %archpms;