File: postrm

package info (click to toggle)
littex 20070713-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 3,300 kB
  • ctags: 2
  • sloc: sh: 98; makefile: 37
file content (71 lines) | stat: -rw-r--r-- 1,892 bytes parent folder | download
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
#! /bin/sh
# postrm script for littex
#

set -e

# summary of how this script can be called:
#        * <postrm> `remove'
#        * <postrm> `purge'
#        * <old-postrm> `upgrade' <new-version>
#        * <new-postrm> `failed-upgrade' <old-version>
#        * <new-postrm> `abort-install'
#        * <new-postrm> `abort-install' <old-version>
#        * <new-postrm> `abort-upgrade' <old-version>
#        * <disappearer's-postrm> `disappear' <r>overwrit>r> <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

PACKAGE=littex

remove_conffile_rollback () {
  # syntax: remove_conffile_rollback filename
  #
  # Roll back the removal of a conffile "filename".
  #
  # Call this function from a postrm script in the event $1 is "abort-upgrade"
  # or "abort-install" is  after having used remove_conffile_prepare() in the
  # preinst.

  # validate arguments
  if [ $# -ne 2 ]; then
    echo "remove_conffile_rollback() called with wrong number of" \
                "arguments; expected 2, got $#"
    exit 2
  fi

  conffile="$1"
  newloc="$2"

  # if the temporary file created by remove_conffile_prepare() exists, move it
  # back
  if [ -e "$conffile.${PACKAGE}-tmp" ]; then
    echo "rolling back removal of obsolete conffile $conffile"
    mv "$conffile.${PACKAGE}-tmp" "$conffile"
  fi
  if [ -e "$newloc" ] ; then
    echo "rolling back changed $conffile from $newloc"
    mv "$newloc" "$conffile"
  fi
}

case "$1" in
    abort-install|abort-upgrade)
	remove_conffile_rollback /etc/texmf/updmap.d/10littex.cfg	\
			/etc/texmf/updmap.d/20littex.cfg
	remove_conffile_rollback /etc/texmf/language.d/10littex.cnf	\
			/etc/texmf/language.d/20littex.cnf
	;;

    purge|remove|upgrade|failed-upgrade|disappear)
        ;;

    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1

esac

#DEBHELPER#

exit 0