prerm is in python-moinmoin 1.9.3-1ubuntu2.
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 | #!/bin/sh
set -e
rename_conffile_rollback () {
# syntax: rename_conffile_rollback old_name new_name
#
# Roll back the renaming of a conffile from "old_name" to "new_name".
#
# Call this function from a postrm script in the event $1 is "abort-upgrade"
# or "abort-install" is after having used rename_conffile_prepare() in the
# preinst.
# local conffile
# Validate arguments.
if [ $# -ne 1 ]; then
echo "$0: usage error: rename_conffile_rollback() called with wrong number of arguments (expected 1, got $#)."
exit 2
fi
_old_conffile="$1"
_new_conffile="$2"
# If the temporary file created by rename_conffile_prepare() exists,
# rename _new_conffile to _old_conffile.
if [ -e "$_old_conffile.python-moinmoin.moved" ]; then
echo "Rolling back renaming of conffile $_old_conffile to $_new_conffile." >&2
mv "$_new_conffile" "$_old_conffile"
rm "$_old_conffile.python-moinmoin.moved"
fi
}
# Automatically added by dh_python2:
if which pyclean >/dev/null 2>&1; then
pyclean -p python-moinmoin
else
dpkg -L python-moinmoin | grep \.py$ | while read file
do
rm -f "${file}"[co] >/dev/null
done
fi
# End automatically added section
if [ "$1" = "abort-install" ] || [ "$1" = "abort-upgrade" ]; then
rename_conffile_rollback /etc/moin/moinmaster.py /etc/moin/mywiki.py
fi
|