From 0afac96f286456aa65109ccb92cf03f79c964c0f Mon Sep 17 00:00:00 2001 From: Antti Ajanki Date: Wed, 25 Aug 2010 20:47:32 +0300 Subject: postinst and preinst in correct packages --- debian/postinst | 43 ------------------------------- debian/preinst | 50 ------------------------------------- debian/vdr-plugin-webvideo.postinst | 43 +++++++++++++++++++++++++++++++ debian/vdr-plugin-webvideo.preinst | 50 +++++++++++++++++++++++++++++++++++++ 4 files changed, 93 insertions(+), 93 deletions(-) delete mode 100644 debian/postinst delete mode 100644 debian/preinst create mode 100644 debian/vdr-plugin-webvideo.postinst create mode 100644 debian/vdr-plugin-webvideo.preinst (limited to 'debian') diff --git a/debian/postinst b/debian/postinst deleted file mode 100644 index 33bb639..0000000 --- a/debian/postinst +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh -# postinst script for vdr-plugin-webvideo -# -# see: dh_installdeb(1) - -set -e - -# summary of how this script can be called: -# * `configure' -# * `abort-upgrade' -# * `abort-remove' `in-favour' -# -# * `abort-remove' -# * `abort-deconfigure' `in-favour' -# `removing' -# -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - -case "$1" in - configure) - chown vdr:vdr /var/lib/webvideo - chmod g=rwx /var/lib/webvideo - ;; - - abort-upgrade|abort-remove|abort-deconfigure) - ;; - - *) - echo "postinst 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 - - diff --git a/debian/preinst b/debian/preinst deleted file mode 100644 index 93f4653..0000000 --- a/debian/preinst +++ /dev/null @@ -1,50 +0,0 @@ -#!/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 diff --git a/debian/vdr-plugin-webvideo.postinst b/debian/vdr-plugin-webvideo.postinst new file mode 100644 index 0000000..33bb639 --- /dev/null +++ b/debian/vdr-plugin-webvideo.postinst @@ -0,0 +1,43 @@ +#!/bin/sh +# postinst script for vdr-plugin-webvideo +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + chown vdr:vdr /var/lib/webvideo + chmod g=rwx /var/lib/webvideo + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst 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 + + diff --git a/debian/vdr-plugin-webvideo.preinst b/debian/vdr-plugin-webvideo.preinst new file mode 100644 index 0000000..93f4653 --- /dev/null +++ b/debian/vdr-plugin-webvideo.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 -- cgit v1.2.3