From 32b1795d4194627ee7ce653eb4b211388b0f7ce9 Mon Sep 17 00:00:00 2001 From: Armin Berres Date: Wed, 21 Jul 2010 16:55:46 +0200 Subject: Changes: handle different options for debian install scripts appropriately RevBy: Tomas Junnonen Details: So far everyting involving the postrm script of libmeegotouchcore0 made the script delete the cache directory. Actually it should just be deleted when the package is removed. --- debian/libmeegotouchcore0.postinst | 38 ++++++++++++++++++++++++++++++--- debian/libmeegotouchcore0.postrm | 43 ++++++++++++++++++++++++++++++++++---- 2 files changed, 74 insertions(+), 7 deletions(-) (limited to 'debian') diff --git a/debian/libmeegotouchcore0.postinst b/debian/libmeegotouchcore0.postinst index dffa9b1a..6de00b5f 100755 --- a/debian/libmeegotouchcore0.postinst +++ b/debian/libmeegotouchcore0.postinst @@ -1,6 +1,38 @@ #!/bin/sh +set -e -# create cache directory -mkdir -p -m a+w /var/cache/meegotouch -mkdir -p -m a+w /var/cache/meegotouch/css +# 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) + # create cache directory + mkdir -p -m a+w /var/cache/meegotouch + mkdir -p -m a+w /var/cache/meegotouch/css + ;; + + 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/libmeegotouchcore0.postrm b/debian/libmeegotouchcore0.postrm index 180f2b2f..f3c0c1da 100755 --- a/debian/libmeegotouchcore0.postrm +++ b/debian/libmeegotouchcore0.postrm @@ -1,6 +1,41 @@ #!/bin/sh +set -e + +# summary of how this script can be called: +# * `remove' +# * `purge' +# * `upgrade' +# * `failed-upgrade' +# * `abort-install' +# * `abort-install' +# * `abort-upgrade' +# * `disappear' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + purge|remove|disappear) + # remove cached data + if [ -d /var/cache/meegotouch ]; then + rm -rf /var/cache/meegotouch + fi + ;; + + failed-upgrade|abort-install|abort-upgrade) + ;; + + *) + echo "postrm 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 -# remove cached data -if [ -d /var/cache/meegotouch ]; then - rm -rf /var/cache/meegotouch -fi -- cgit v1.2.3