]> err.no Git - dak/commit
error out if sql query fails
authorAnsgar Burchardt <ansgar@debian.org>
Thu, 12 Jul 2012 15:59:43 +0000 (09:59 -0600)
committerAnsgar Burchardt <ansgar@debian.org>
Fri, 13 Jul 2012 02:26:33 +0000 (20:26 -0600)
commit01bea71d37e475eb08b1bc4e3e4fcd1cf62b078a
treefe204bfdb2821395b2ccf6a4b62b2ffb9e43976d
parent7538a1a1c81d363bc685bea55e220763280c0c16
error out if sql query fails

Using "echo ... | psql" does not generate an error when something goes
wrong.  Using "psql -c ..." instead does:

  $ echo "SELECT * FROM does_not_exist" | psql projectb 2>/dev/null; echo $?
  0

  $ q="SELECT * FROM does_not_exist"; psql -c "$q" projectb 2>/dev/null; echo $?
  1

This patch switches dak to use the second form to avoid silenty ignoring
errors.

Signed-off-by: Ansgar Burchardt <ansgar@debian.org>
config/backports/dinstall.functions
config/debian/dinstall.functions