diff options
author | Antti Ajanki <antti.ajanki@iki.fi> | 2010-08-17 19:49:53 +0300 |
---|---|---|
committer | Antti Ajanki <antti.ajanki@iki.fi> | 2010-08-17 19:49:53 +0300 |
commit | 877620a472fd84cf7ca68ed4918ee602f793c1e3 (patch) | |
tree | 17c448bd986e21d78eff2917ebd8a968e6fee30c /debian | |
parent | 7e0babe7ffd6cc1d15d7936e20932931fe1df916 (diff) | |
download | vdr-plugin-webvideo-877620a472fd84cf7ca68ed4918ee602f793c1e3.tar.gz vdr-plugin-webvideo-877620a472fd84cf7ca68ed4918ee602f793c1e3.tar.bz2 |
Remove obsolete conffiles in preinst
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | debian/preinst | 50 |
2 files changed, 56 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index bb9769c..3ebf25b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vdr-plugin-webvideo (0.3.2-1) unstable; urgency=low + + * Remove conffiles that have been obsolete since 0.2.0-1 + + -- Antti Ajanki <antti.ajanki@iki.fi> Tue, 17 Aug 2010 19:46:49 +0300 + vdr-plugin-webvideo (0.3.1-1) unstable; urgency=low * Updated Italian translation (thanks to Diego Pierotto). diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000..93f4653 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,50 @@ +#!/bin/sh +# preinst script for vdr-plugin-webvideo +# +# see: dh_installdeb(1) + +set -e + +# Remove a no-longer used conffile +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 "Obsolete conffile $CONFFILE has been modified by you." + echo "Saving as $CONFFILE.dpkg-bak ..." + mv -f "$CONFFILE" "$CONFFILE".dpkg-bak + else + echo "Removing obsolete conffile $CONFFILE ..." + rm -f "$CONFFILE" + fi +} + +case "$1" in + install|upgrade) + if dpkg --compare-versions "$2" le 0.3.1-1; then + rm_conffile vdr-plugin-webvideo "/etc/init.d/vdr-plugin-webvideo" + rm_conffile vdr-plugin-webvideo "/etc/default/vdr-plugin-webvideo" + fi + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 |