~ubuntu-branches/ubuntu/natty/moin/natty-updates

« back to all changes in this revision

Viewing changes to debian/moinmoin-common.prerm

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Smedegaard
  • Date: 2008-06-22 21:17:13 UTC
  • mfrom: (0.9.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080622211713-fpo2zrq3s5dfecxg
Tags: 1.7.0-3
Simplify /etc/moin/wikilist format: "USER URL" (drop unneeded middle
CONFIG_DIR that was wrongly advertised as DATA_DIR).  Make
moin-mass-migrate handle both formats and warn about deprecation of
the old one.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
set -e
4
 
 
5
 
rename_conffile_rollback () {
6
 
# syntax: rename_conffile_rollback old_name new_name
7
 
#
8
 
# Roll back the renaming of a conffile from "old_name" to "new_name".
9
 
#
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
12
 
# preinst.
13
 
 
14
 
        # local conffile
15
 
 
16
 
        # Validate arguments.
17
 
        if [ $# -ne 1 ]; then
18
 
        echo "$0: usage error: rename_conffile_rollback() called with wrong number of arguments (expected 1, got $#)."
19
 
                exit 2
20
 
        fi
21
 
 
22
 
        _old_conffile="$1"
23
 
        _new_conffile="$2"
24
 
 
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"
31
 
        fi
32
 
}
33
 
 
34
 
#DEBHELPER#
35
 
 
36
 
if [ "$1" = "abort-install" ] || [ "$1" = "abort-upgrade" ]; then
37
 
        rename_conffile_rollback /etc/moin/moinmaster.py /etc/moin/mywiki.py
38
 
fi