Commit bdf6b888 authored by Magnus Hagander's avatar Magnus Hagander

More detailed error msg (with stack trace) if a file copy fails.

parent fa8a9f37
...@@ -3,7 +3,7 @@ package Install; ...@@ -3,7 +3,7 @@ package Install;
# #
# Package that provides 'make install' functionality for msvc builds # Package that provides 'make install' functionality for msvc builds
# #
# $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.22 2007/09/27 21:13:11 adunstan Exp $ # $PostgreSQL: pgsql/src/tools/msvc/Install.pm,v 1.23 2007/10/03 13:20:40 mha Exp $
# #
use strict; use strict;
use warnings; use warnings;
...@@ -22,9 +22,14 @@ sub lcopy ...@@ -22,9 +22,14 @@ sub lcopy
my $src = shift; my $src = shift;
my $target = shift; my $target = shift;
unlink $target if -f $target; if (-f $target)
{
unlink $target || confess "Could not delete $target\n";
}
copy($src,$target)
|| confess "Could not copy $src to $target\n";
copy($src,$target);
} }
sub Install sub Install
...@@ -123,8 +128,7 @@ sub CopyFiles ...@@ -123,8 +128,7 @@ sub CopyFiles
print "."; print ".";
$f = $basedir . $f; $f = $basedir . $f;
die "No file $f\n" if (!-f $f); die "No file $f\n" if (!-f $f);
lcopy($f, $target . basename($f)) lcopy($f, $target . basename($f));
|| croak "Could not copy $f to $target". basename($f). " to $target". basename($f) . "\n";
} }
print "\n"; print "\n";
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment