postrm is in redmine 2.4.2-1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | #!/bin/sh
# postrm script for redmine
#
# see: dh_installdeb(1)
set -e
#set -x
if [ -f /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
fi
case "$1" in
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
;;
remove)
if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
db_get redmine/old-instances || true
gOldInstances="${RET}"
for lInstance in $gOldInstances; do
db_get redmine/instances/$lInstance/dbconfig-install || true
if [ "$RET" = "true" ]; then
( . /usr/share/dbconfig-common/dpkg/postrm ; dbc_go redmine/instances/$lInstance $@ )
fi
done
db_get redmine/current-instances || true
gInstances="${RET}"
for lInstance in $gInstances; do
db_get redmine/instances/$lInstance/dbconfig-install || true
if [ "$RET" = "true" ]; then
( . /usr/share/dbconfig-common/dpkg/postrm ; dbc_go redmine/instances/$lInstance $@ )
fi
done
fi
;;
purge)
db_get redmine/old-instances || true
gOldInstances="${RET}"
db_get redmine/current-instances || true
gInstances="${RET}"
if [ -f /usr/share/dbconfig-common/dpkg/postrm ]; then
for lInstance in $gOldInstances; do
db_get redmine/instances/$lInstance/dbconfig-install || true
if [ "$RET" = "true" ]; then
( . /usr/share/dbconfig-common/dpkg/postrm ; dbc_go redmine/instances/$lInstance $@ )
fi
done
for lInstance in $gInstances; do
db_get redmine/instances/$lInstance/dbconfig-install || true
if [ "$RET" = "true" ]; then
( . /usr/share/dbconfig-common/dpkg/postrm ; dbc_go redmine/instances/$lInstance $@ )
fi
done
fi
if which ucf >/dev/null 2>&1; then
for lInstance in $gOldInstances; do
ucf --purge /etc/redmine/$lInstance/database.yml
ucf --purge /etc/redmine/$lInstance/session.yml
ucf --purge /etc/redmine/$lInstance/configuration.yml
# email.yml was renamed to configuration.yml since 1.2.0
ucf --purge /etc/redmine/$lInstance/email.yml
done
for lInstance in $gInstances; do
ucf --purge /etc/redmine/$lInstance/database.yml
ucf --purge /etc/redmine/$lInstance/session.yml
ucf --purge /etc/redmine/$lInstance/configuration.yml
# email.yml was renamed to configuration.yml since 1.2.0
ucf --purge /etc/redmine/$lInstance/email.yml
done
fi
# package-generated or runtime files are removed
rm -f /usr/share/redmine/db/schema.db
# removing /var/run files is not needed : it is mounted tmpfs in wheezy - anyway it does not hurt
rm -rf /var/run/redmine
rm -rf /var/log/redmine
rm -rf /usr/share/redmine/tmp
rm -rf /var/lib/redmine/*/sessions
rm -rf /var/cache/redmine
rm -rf /etc/redmine
# user files are not
rmdir /var/lib/redmine/*/files || true
rmdir /var/lib/redmine/* || true
db_purge
;;
*)
echo "postrm called with unknown argument \`$1'" >&2
exit 1
;;
esac
# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
. /usr/share/debconf/confmodule
db_purge
fi
# End automatically added section
exit 0
|