X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/cad0fd6e0f3f4a76a732131ae043d68c84e2c2fd..a1c5c71fe2050df4fabab092c42ee711692880fa:/installperl diff --git a/installperl b/installperl index 06121e0..73448df 100755 --- a/installperl +++ b/installperl @@ -156,26 +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); - - # 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 hyphenated 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; @@ -558,21 +565,6 @@ my $pod = ($Is_Cygwin || $Is_Darwin || $Is_VMS || $Is_W32) ? 'pods' : 'pod'; if ( !$versiononly || ($installprivlib =~ m/\Q$vershort/)) { mkpath("${installprivlib}/$pod", $opts{verbose}, 0777); - # If Perl 5.003's perldiag.pod is there, rename it. - if (open POD, "${installprivlib}/$pod/perldiag.pod") { - read POD, $_, 4000; - close POD; - # Some of Perl 5.003's diagnostic messages ended with periods. - if (/^=.*\.$/m) { - my ($from, $to) = ("${installprivlib}/$pod/perldiag.pod", - "${installprivlib}/$pod/perldiag-5.003.pod"); - print " rename $from $to"; - rename($from, $to) - or warn "Couldn't rename $from to $to: $!\n" - unless $opts{notify}; - } - } - for (@pods) { # $_ is a name like pod/perl.pod (my $base = $_) =~ s#.*/##; @@ -709,21 +701,36 @@ sub installlib { # ignore patch backups, RCS files, emacs backup & temp files and the # .exists files, .PL files, and test files. - return if $name =~ m{\.orig$|\.rej$|~$|^#.+#$|,v$|^\.exists|\.PL$|\.plc$|\.t$|^test\.pl$|^dbm_filter_util.pl$} || + return if $name =~ m{\.orig$|\.rej$|~$|^#.+#$|,v$|^\.exists|\.PL$|\.plc$|\.t$|^test\.pl$|^dbm_filter_util\.pl$|^filter-util\.pl$|^uupacktool\.pl$|^\.gitignore$} || $dir =~ m{/t(?:/|$)}; # ignore the cpan script in lib/CPAN/bin, the instmodsh and xsubpp # scripts in lib/ExtUtils, the prove script in lib/Test/Harness, # the corelist script from lib/Module/CoreList/bin and ptar* in # lib/Archive/Tar/bin, the config_data script in lib/Module/Build/scripts # (they're installed later with other utils) - return if $name =~ /^(?:cpan|instmodsh|prove|corelist|ptar|cpan2dist|cpanp|cpanp-run-perl|ptardiff|config_data)\z/; + return if $name =~ /^(?:cpan|instmodsh|prove|corelist|ptar|cpan2dist|cpanp|cpanp-run-perl|ptardiff|ptargrep|config_data)\z/; # ignore the Makefiles return if $name =~ /^makefile$/i; # ignore the test extensions return if $dir =~ m{\bXS/(?:APItest|Typemap)\b}; return if $name =~ m{\b(?:APItest|Typemap)\.pm$}; + # ignore the build support code + return if $name =~ /\bbuildcustomize\.pl$/; # ignore the demo files return if $dir =~ /\b(?:demos?|eg)\b/; + # ignore unneeded unicore files + if ( $dir =~ /^unicore/ ) { + if ( $name =~ /\.txt\z/ ) { + # We can ignore most, but not all .txt files + return unless $name =~ /\A(?:Blocks|CaseFolding|SpecialCasing|NamedSequences)\.txt\z/; + } + else { + # TestProp only needed during testing + return if $name =~ /\ATestProp.pl\z/; + # we need version and *.pl files and can skip the rest + return unless $name =~ /\A(?:version|\w+\.pl)\z/; + } + } # ignore READMEs, MANIFESTs, INSTALL docs, META.ymls and change logs. # Changes.e2x and README.e2x are needed by enc2xs. @@ -749,7 +756,7 @@ sub installlib { if ($dir =~ /^auto\// || ($name =~ /^(.*)\.(?:pm|pod)$/ && $archpms{$1}) || ($name =~ /^(.*)\.(?:h|lib)$/i && ($Is_W32 || $Is_NetWare)) || - $name=~/^Config_(heavy\|git)\.pl\z/ + $name=~/^Config_(heavy|git)\.pl\z/ ) { $installlib = $installarchlib; return unless $do_installarchlib;