Package: dbconfig-common
Version: 1.8.37
Severity: normal
Tags: patch

When a database upgrade is performed, $dbc_dump_cmd failure makes the
postinst exit if 'set -e' is in effect.

 creating database backup in 
/var/cache/dbconfig-common/backups/request-tracker3.6_3.6.1-4.mysql.
 dpkg: error processing request-tracker3.6 (--install):
  subprocess post-installation script returned error exit status 1

Catching a failure with dbc_upgrade_error() is easy, although still not
optimal because of the wording of the dbconfig-common/upgrade-error
template. I suppose a separate template for this would be overkill,
though.

Simple patch attached.

Cheers,
-- 
Niko Tyni   [EMAIL PROTECTED]
diff --git a/dpkg/postinst b/dpkg/postinst
index 6a1b7fe..7357325 100644
--- a/dpkg/postinst
+++ b/dpkg/postinst
@@ -169,7 +169,7 @@ dbc_go(){
 				dbc_logline "creating database backup in $dumpfile"
 				# backup before we upgrade
 				_dbc_asuser=""
-				$dbc_dump_cmd $dumpfile
+				$dbc_dump_cmd $dumpfile || dbc_upgrade_error "backing up the old database"
 			fi
 
 			# now perform the updates

Reply via email to