tag 688713 + patch thanks Hi,
I tried to fix this bug. In this patch, dpkg-maintscript-helper is used instead of old rm_conffile(). Please see dpkg-maintscript-helper(1) for its usage. If you release the fix as 2.13.2-41, then put 2.13.2-41~ as parameter for dpkg-maintscript-helper should be correct, I guess. You may need to change the "2.13.2-41~" if it's not the case. As in: dpkg-maintscript-helper rm_conffile \ /etc/timidity/timidity.daemon 2.13.2-41~ timidity-daemon -- "$@" Cheers, Guo Yixuan
>From 62b51523e6a4d802567358bc3c9758cf9b1e1a9c Mon Sep 17 00:00:00 2001 From: Guo Yixuan <culu....@gmail.com> Date: Wed, 26 Sep 2012 11:48:31 +0800 Subject: [PATCH] fix --- timidity-daemon.postinst | 3 ++- timidity-daemon.postrm | 10 ++++++++++ timidity-daemon.preinst | 3 +++ timidity-daemon.prerm | 42 ------------------------------------------ 4 files changed, 15 insertions(+), 43 deletions(-) create mode 100644 timidity-daemon.postrm delete mode 100644 timidity-daemon.prerm diff --git a/timidity-daemon.postinst b/timidity-daemon.postinst index f95270d..166db43 100644 --- a/timidity-daemon.postinst +++ b/timidity-daemon.postinst @@ -50,7 +50,8 @@ fi ;; esac -rm -f /etc/timidity/timidity.daemon +dpkg-maintscript-helper rm_conffile \ + /etc/timidity/timidity.daemon 2.13.2-41~ timidity-daemon -- "$@" # make sure we really stop, because packaging system doesn't # understand what we're trying to do with migration to timidity-daemon diff --git a/timidity-daemon.postrm b/timidity-daemon.postrm new file mode 100644 index 0000000..22c3dec --- /dev/null +++ b/timidity-daemon.postrm @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +dpkg-maintscript-helper rm_conffile \ + /etc/timidity/timidity.daemon 2.13.2-41~ timidity-daemon -- "$@" + +#DEBHELPER# + +exit 0 + diff --git a/timidity-daemon.preinst b/timidity-daemon.preinst index afd27ac..ce8e04b 100644 --- a/timidity-daemon.preinst +++ b/timidity-daemon.preinst @@ -20,6 +20,9 @@ case "$1" in ;; esac +dpkg-maintscript-helper rm_conffile \ + /etc/timidity/timidity.daemon 2.13.2-41~ timidity-daemon -- "$@" + # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. diff --git a/timidity-daemon.prerm b/timidity-daemon.prerm deleted file mode 100644 index f0b1dd9..0000000 --- a/timidity-daemon.prerm +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/sh -set -e - -rm_conffile() { - local PKGNAME="$1" - local CONFFILE="$2" - - [ -e "$CONFFILE" ] || return 0 - - local md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')" - local old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | \ - sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")" - if [ "$md5sum" != "$old_md5sum" ]; then - echo "init.d conffile $CONFFILE has been modified by you." - echo "Saving as $CONFFILE.dpkg-bak ..." - mv -f "$CONFFILE" "$CONFFILE".dpkg-bak - else - echo "Removing init.d conffile $CONFFILE ..." - rm -f "$CONFFILE" - fi -} - -case "$1" in -remove) - if [ -f "/etc/init.d/timidity" ]; then - if which invoke-rc.d >/dev/null 2>&1; then - invoke-rc.d timidity stop - else - /etc/init.d/timidity stop - fi - fi - - rm_conffile timidity-daemon /etc/init.d/timidity - rm_conffile timidity-daemon /etc/timidity/timidity.daemon - -;; -esac - -#DEBHELPER# - -exit 0 - -- 1.7.10.4