develooper Front page | perl.perl5.porters | Postings from November 2003

[PATCH 5.8.2 @21574] make install not installing fully

Thread Next
From:
Ilya Zakharevich
Date:
November 4, 2003 20:07
Subject:
[PATCH 5.8.2 @21574] make install not installing fully
Message ID:
20031105040725.GA2629@math.berkeley.edu
On OS/2 File::Copy::copy would not overwrite by default.  Thus some
files may not be updated by `make install'.

Enjoy,
Ilya

--- ./installperl-pre	Sun Aug 31 09:58:48 2003
+++ ./installperl	Tue Nov  4 19:43:10 2003
@@ -737,14 +756,16 @@ sub link {
 	$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;
-	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;
@@ -767,9 +788,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;
-    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' };
 }
 

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About