This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make install not installing fully
authorIlya Zakharevich <ilya@math.berkeley.edu>
Tue, 4 Nov 2003 20:07:25 +0000 (12:07 -0800)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Wed, 12 Nov 2003 09:46:51 +0000 (09:46 +0000)
Message-ID: <20031105040725.GA2629@math.berkeley.edu>

p4raw-id: //depot/perl@21708

installperl

index 58c81f5..cdc8fc8 100755 (executable)
@@ -727,14 +727,16 @@ sub link {
        $packlist->{$xto} = { from => $xfrom, type => 'link' };
     };
     if ($@) {
        $packlist->{$xto} = { from => $xfrom, type => 'link' };
     };
     if ($@) {
-       warn $@;
+       warn "Replacing link() with File::Copy::copy(): $@";
        print $verbose ? "  cp $from $xto\n" : "  $xto\n" unless $silent;
        print "  creating new version of $xto\n"
                 if $Is_VMS and -e $to and !$silent;
        print $verbose ? "  cp $from $xto\n" : "  $xto\n" unless $silent;
        print "  creating new version of $xto\n"
                 if $Is_VMS and -e $to and !$silent;
-       File::Copy::copy($from, $to)
-           ? $success++
-           : warn "Couldn't copy $from to $to: $!\n"
-         unless $nonono;
+       unless ($nonono or File::Copy::copy($from, $to) and ++$success) {
+           # Might have been that F::C::c can't overwrite the target
+           warn "Couldn't copy $from to $to: $!\n"
+               unless -f $to and (chmod(0666, $to), unlink $to)
+                       and File::Copy::copy($from, $to) and ++$success;
+       }
        $packlist->{$xto} = { type => 'file' };
     }
     $success;
        $packlist->{$xto} = { type => 'file' };
     }
     $success;
@@ -757,9 +759,12 @@ sub copy {
     $xto =~ s/^\Q$destdir\E// if $destdir;
     print $verbose ? "  cp $from $xto\n" : "  $xto\n" unless $silent;
     print "  creating new version of $xto\n" if $Is_VMS and -e $to and !$silent;
     $xto =~ s/^\Q$destdir\E// if $destdir;
     print $verbose ? "  cp $from $xto\n" : "  $xto\n" unless $silent;
     print "  creating new version of $xto\n" if $Is_VMS and -e $to and !$silent;
-    File::Copy::copy($from, $to)
-       || warn "Couldn't copy $from to $to: $!\n"
-      unless $nonono;
+    unless ($nonono or File::Copy::copy($from, $to)) {
+       # Might have been that F::C::c can't overwrite the target
+       warn "Couldn't copy $from to $to: $!\n"
+           unless -f $to and (chmod(0666, $to), unlink $to)
+                  and File::Copy::copy($from, $to);
+    }
     $packlist->{$xto} = { type => 'file' };
 }
 
     $packlist->{$xto} = { type => 'file' };
 }