5
rename_conffile_rollback () {
6
# syntax: rename_conffile_rollback old_name new_name
8
# Roll back the renaming of a conffile from "old_name" to "new_name".
10
# Call this function from a postrm script in the event $1 is "abort-upgrade"
11
# or "abort-install" is after having used rename_conffile_prepare() in the
18
echo "$0: usage error: rename_conffile_rollback() called with wrong number of arguments (expected 1, got $#)."
25
# If the temporary file created by rename_conffile_prepare() exists,
26
# rename _new_conffile to _old_conffile.
27
if [ -e "$_old_conffile.moinmoin-common.moved" ]; then
28
echo "Rolling back renaming of conffile $_old_conffile to $_new_conffile." >&2
29
mv "$_new_conffile" "$_old_conffile"
30
rm "$_old_conffile.moinmoin-common.moved"
36
if [ "$1" = "abort-install" ] || [ "$1" = "abort-upgrade" ]; then
37
rename_conffile_rollback /etc/moin/moinmaster.py /etc/moin/mywiki.py