File: template.postrm

package info (click to toggle)
bacula 15.0.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,780 kB
  • sloc: ansic: 194,276; cpp: 41,177; sh: 28,258; python: 6,669; makefile: 5,275; perl: 3,666; sql: 1,371; java: 345; xml: 196; awk: 51; sed: 25
file content (68 lines) | stat: -rw-r--r-- 1,323 bytes parent folder | download | duplicates (7)
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
#!/bin/sh

set -e

# autopostrm will replace this with a variable containing the package
# name and the contents of the debian/<package>.autopostrm files

#AUTOPOSTRM#

# helper functions to purge conffiles
# with and without ucf deregistration

# delete a list of files, also with known backup extensions
purge_conf() {
    local file ext

    for file in $@; do
	rm -f $file
	for ext in '~' '%' .bak .ucf-new .ucf-old .ucf-dist .dist; do
	    rm -f $file$ext
	done
    done
}

# unregister a list of conffiles from ucf after deleting them
# usage: purge_ucf_conf <packagename> <conffile ...>
purge_ucf_conf() {
    local package file

    # save package name
    package=$1
    # remove first argument from list
    shift

    purge_conf $@
    if [ -x "`which ucf`" ]; then
	for file in $@; do
	    ucf --purge $file
	    ucfr --purge $package $file
	done
    fi
}

case "$1" in
    purge)
	if [ -n "$CONFFILES" ]; then
	    purge_conf $CONFFILES
	fi
	if [ -n "$UCF_CONFFILES" ]; then
	    purge_ucf_conf $PACKAGE $UCF_CONFFILES
	fi
	;;

    remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
	;;

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

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0