Permalink
Browse files

Fix the return code

  • Loading branch information...
1 parent 12b852e commit 89c7b6f7794d8c64adfa4681b6323b787a22521f @ringerc ringerc committed Jan 9, 2013
Showing with 8 additions and 5 deletions.
  1. +3 −1 PgBuildWin/DetectSDK.pm
  2. +3 −2 PgBuildWin/PgBuildWin.pm
  3. +1 −1 buildcwd.pl
  4. +1 −1 buildgit.pl
@@ -22,15 +22,17 @@ sub get_vc_info() {
# Try to determine the cl.exe version
open(CLOUTPUT, "cl 2>&1 |") or die ("Failed to exec cl.exe: $!");
my $clvers;
+ my @cloutput = ();
while (<CLOUTPUT>) {;
+ push(@cloutput, $_);
if (/.*Version\s(\d{1,3})/) {
$clvers = $1;
last;
}
}
close(CLOUTPUT);
if (!defined($clvers)) {
- die("cl.exe executed, but unable to determine cl.exe version from output");
+ die("cl.exe executed, but unable to determine cl.exe version from output. Output was: \n" . join("\n",@cloutput));
}
# If we're running under a Visual Studio SDK set up with vcvarsall.bat,
@@ -58,9 +58,10 @@ sub build($) {
print $cmd . "\n";
my $ret = system($cmd);
if ($ret != 0) {
- print("Build failed, return code from nmake was $ret\n");
+ my $shellret = $ret >> 8;
+ print("Build failed, return code from nmake was $shellret (system() returned $ret)\n");
} else {
print("Build successful");
}
- return $ret == 0;
+ return ($ret == 0);
}
View
@@ -13,4 +13,4 @@
if (! -e 'src\tools\msvc\build.pl') {
die('src\tools\msvc\build.pl not found - did you run buildcwd.pl from a PostgreSQL source tree? See the README.');
}
-build(0);
+build(0) or die("Build failed.");
View
@@ -10,4 +10,4 @@
die("Don't pass USE_GIT on the command line. Use buildgit.pl instead.");
}
}
-build(1);
+build(1) or die("Build failed.");

0 comments on commit 89c7b6f

Please sign in to comment.