~ubuntu-branches/ubuntu/gutsy/mon/gutsy-updates

« back to all changes in this revision

Viewing changes to debian/postrm

  • Committer: Bazaar Package Importer
  • Author(s): Roderick Schertler
  • Date: 2001-09-15 08:46:38 UTC
  • Revision ID: james.westby@ubuntu.com-20010915084638-4rxzfl19jwqn6rjb
Tags: 0.99.2-2
Don't use \c in echo, as bash (invoked as sh) doesn't accept it, even
though it's mandated by POSIX (closes: #112280).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
 
 
3
# $Id: postrm,v 1.2 1998/10/13 03:39:01 roderick Exp $
 
4
 
 
5
#DEBHELPER#
 
6
 
 
7
any_output=
 
8
domv() {
 
9
    [ -f "$1" -a ! -f "$2" ] || return 0
 
10
 
 
11
    [ -n "$any_output" ] && echo
 
12
    any_output=t
 
13
 
 
14
    echo "In the older version of mon you're downgrading to, the $1 file" \
 
15
            "is kept at $2." | fmt
 
16
    while :
 
17
    do
 
18
        echo -n "Would you like me to move the existing file" \
 
19
                "to the old location? [Y] "
 
20
        read reply
 
21
        [ -z "$reply" ] && reply=y
 
22
        case $reply in
 
23
            [yY]*)
 
24
                dir=`dirname "$2"`
 
25
                [ -d "$dir" ] || {
 
26
                    echo "mkdir $dir"
 
27
                    mkdir $dir
 
28
                }
 
29
                echo "mv $1 $2"
 
30
                mv "$1" "$2"
 
31
                return
 
32
                ;;
 
33
            [nN]*)
 
34
                echo "Leaving existing file in place."
 
35
                return
 
36
                ;;
 
37
        esac
 
38
        echo "Invalid response \`$reply', answer with Y or N."
 
39
    done
 
40
}
 
41
 
 
42
# Before 0.37l /etc/mon didn't exist.
 
43
if [ x-"$1" = x-upgrade -a $# = 2 ] &&
 
44
        dpkg --compare-versions "$2" lt 0.37l
 
45
then
 
46
    domv /etc/mon/mon.cf /etc/mon.cf
 
47
    domv /etc/mon/netappfree.cf /usr/lib/mon/etc/netappfree.cf
 
48
fi