This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Split out S_refcounted_he_new_common() from
[perl5.git] / installperl
index ddd3a4b..b89990b 100755 (executable)
@@ -54,6 +54,7 @@ use File::Compare;
 use File::Copy ();
 use File::Path ();
 use ExtUtils::Packlist;
+use Cwd;
 use Config;
 use subs qw(unlink link chmod);
 
@@ -282,7 +283,7 @@ if (($Is_W32 and ! $Is_NetWare) or $Is_Cygwin) {
 
     if ($Is_Cygwin) {
        $perldll = $libperl;
-       my $v_e_r_s = $ver; $v_e_r_s =~ tr/./_/;
+       my $v_e_r_s = substr($ver,0,-2); $v_e_r_s =~ tr/./_/;
        $perldll =~ s/(\..*)?$/$v_e_r_s.$dlext/;
        $perldll =~ s/^lib/cyg/;
     } else {
@@ -367,6 +368,7 @@ if ($d_dosuid) {
 # Install library files.
 
 my ($do_installarchlib, $do_installprivlib) = (0, 0);
+my $vershort = $Is_Cygwin ? substr($ver,0,-2) : $ver;
 
 mkpath($installprivlib, $verbose, 0777);
 mkpath($installarchlib, $verbose, 0777);
@@ -376,7 +378,7 @@ mkpath($installsitearch, $verbose, 0777) if ($installsitearch);
 if (chdir "lib") {
     $do_installarchlib = ! samepath($installarchlib, '.');
     $do_installprivlib = ! samepath($installprivlib, '.');
-    $do_installprivlib = 0 if $versiononly && !($installprivlib =~ m/\Q$ver/);
+    $do_installprivlib = 0 if $versiononly && !($installprivlib =~ m/\Q$vershort/);
 
     if ($do_installarchlib || $do_installprivlib) {
        find(\&installlib, '.');
@@ -569,7 +571,7 @@ if ($versiononly) {
 # ($installprivlib/pods for cygwin).
 
 my $pod = ($Is_Cygwin || $Is_Darwin || $Is_VMS || $Is_W32) ? 'pods' : 'pod';
-if ( !$versiononly || ($installprivlib =~ m/\Q$ver/)) {
+if ( !$versiononly || ($installprivlib =~ m/\Q$vershort/)) {
     mkpath("${installprivlib}/$pod", $verbose, 0777);
 
     # If Perl 5.003's perldiag.pod is there, rename it.
@@ -620,6 +622,7 @@ if (!$versiononly && $otherperls) {
        # Use &samepath here because some systems have other dirs linked
        # to $mainperldir (like SunOS)
        next if samepath($_, $binexp);
+       next if samepath($_, cwd());
        next if ($mainperl_is_instperl && samepath($_, $mainperldir));
        my $otherperl = "$_/$perl$exe_ext";
        next if $otherperls{$otherperl}++;