File: postrm

package info (click to toggle)
addressbook 0.7-10
  • links: PTS
  • area: main
  • in suites: slink
  • size: 964 kB
  • ctags: 163
  • sloc: tcl: 6,000; perl: 528; ansic: 362; awk: 205; sh: 133; makefile: 100
file content (34 lines) | stat: -rw-r--r-- 868 bytes parent folder | download | duplicates (4)
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
#!/bin/bash

set -e

case "$1" in
    abort-upgrade|abort-install)
	# we are aborting the upgrade, check if we need to move
	# files back into /usr/lib/addressbook, basically backing out
	# the actions of the 'preinst' script
	if dpkg --compare-versions 0.7-4 gt ${2}; then
		[ -d /usr/lib/addressbook ] || mkdir /usr/lib/addressbook
		[ -d /etc/addressbook ] || exit 0
		for file in /etc/addressbook/*; do
			if [ ${file} = "*" ]; then
				exit 0
			fi
			# we have to give it the suffix so it stays around
			# post install of the older (non-config file) version
			echo moving $file to /usr/lib/addressbook/`basename $file`.new
			mv $file /usr/lib/addressbook/`basename $file`.new
		done
	fi
	;;
    remove|purge|upgrade|failed-upgrade)
	# do not need to handle
	;;
    *)
        echo "postrm called with unknown argument \`$1'" >&2
	;;
esac

#DEBHELPER#

exit 0