chiark / gitweb /
Use failedcmd to report errors when ssh psql fails. Closes:#734281.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 18 Jan 2014 23:34:51 +0000 (23:34 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 18 Jan 2014 23:34:51 +0000 (23:34 +0000)
debian/changelog
dgit

index 595e91e4adad9b4ad83899256f86ae6ddd2b803c..6080f8ff0d8b86d3937f7997be29305b5411ed66 100644 (file)
@@ -1,5 +1,6 @@
 dgit (0.21~~iwj) unstable; urgency=low
 
+  * Use failedcmd to report errors when ssh psql fails.  Closes:#734281.
   * Add `Testsuite: autopkgtest' to debian/control.  (This will only have
     the right effect with recent enought dpkg, and will generate a warning
     with earlier versions of dpkg.
diff --git a/dgit b/dgit
index 61af3b81f00a82a323e17e14092c78d8694b6058..94454d33170b15546c42f0d42c77f27d0453ba7f 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -676,7 +676,7 @@ sub sshpsql ($$) {
        printdebug("$debugprefix>|$_|\n");
        push @rows, $_;
     }
-    $!=0; $?=0; close P or die "$! $?";
+    $!=0; $?=0; close P or failedcmd @cmd;
     @rows or die;
     my $nrows = pop @rows;
     $nrows =~ s/^\((\d+) rows?\)$/$1/ or die "$nrows ?";