The previous patch was not quite right; this one is tried and tested. Ben.
diff -u bacula-2.4.2/debian/changelog bacula-2.4.2/debian/changelog --- bacula-2.4.2/debian/changelog +++ bacula-2.4.2/debian/changelog @@ -1,3 +1,10 @@ +bacula (2.4.2-3.1) unstable; urgency=low + + * Fix removal of original configuration file during upgrade of + bacula-director-pgsql. Closes: #496174. + + -- Ben Hutchings <[EMAIL PROTECTED]> Sun, 05 Oct 2008 18:37:23 +0100 + bacula (2.4.2-3) unstable; urgency=low * Apply upstream 2.4.2-verifydisk.patch diff -u bacula-2.4.2/debian/additions/postinst-common bacula-2.4.2/debian/additions/postinst-common --- bacula-2.4.2/debian/additions/postinst-common +++ bacula-2.4.2/debian/additions/postinst-common @@ -4,33 +4,28 @@ DSTDIR="/etc/bacula" CONFIG="bacula-dir.conf" +TMPCONFIG=$DSTDIR/$CONFIG.dpkg-tmp -if [ -f $DSTDIR/$CONFIG.dpkg-tmp ]; then - SOURCE=$DSTDIR/$CONFIG.dpkg-tmp +if [ -f $TMPCONFIG ]; then + SOURCE=$TMPCONFIG else - SOURCE=$DSTDIR/$CONFIG + SOURCE=$DEFCONFIGDIR/$CONFIG fi -if [ -f $DSTDIR/$CONFIG -a ! -f $SOURCE ]; then - echo "Target $DSTDIR/$CONFIG already exists and $SOURCE doesn't" - echo "Not modifying target." +if [ ! -f $DSTDIR/$CONFIG ]; then + TARGET=$DSTDIR/$CONFIG else - if [ ! -f $DSTDIR/$CONFIG ]; then - TARGET=$DSTDIR/$CONFIG - else - TARGET=$DSTDIR/$CONFIG.dist - fi - - # Final config fix - sed -e "s/@hostname@/`hostname`/" < $SOURCE > $TARGET - - # get rid of now unnecessary file - rm -f $SOURCE - # Harden permissions, so that passwords can not be looked at - # Fixed by Philipp M Hahn - chown root:bacula $TARGET - chmod 640 $TARGET - + TARGET=$DSTDIR/$CONFIG.dist fi +# Final config fix +sed -e "s/@hostname@/`hostname`/" < $SOURCE > $TARGET + +# get rid of now unnecessary file +rm -f $TMPCONFIG + +# Harden permissions, so that passwords can not be looked at +# Fixed by Philipp M Hahn +chown root:bacula $TARGET +chmod 640 $TARGET exit 0 --- END ---
signature.asc
Description: This is a digitally signed message part

