po: Update German man pages translation
[dpkg.git] / debian / dpkg.postrm
blob599ffe36857494c5839492c05f0ff254d33fabc7
1 #!/bin/sh
2 # See deb-postrm(5).
4 set -e
6 # Remove log file when dpkg is purged
7 remove_logfile() {
8 local logdir="$DPKG_ROOT/var/log"
10 rm -f "$logdir"/dpkg.log "$logdir"/dpkg.log.* 2>/dev/null
11 rm -f "$logdir"/alternatives.log "$logdir"/alternatives.log.* 2>/dev/null
14 # Remove backward compatibility symlink alias when dpkg is removed.
15 remove_aliases() {
16 local prog=start-stop-daemon
18 if [ -L "$DPKG_ROOT/sbin/$prog" ]; then
19 rm "$DPKG_ROOT/sbin/$prog"
23 # Version 1.22.0 stopped the systemd timer, which meant it would not run
24 # anymore.
25 fixup_systemd_timer() {
26 if [ -d /run/systemd/system ]; then
27 deb-systemd-invoke restart 'dpkg-db-backup.timer' >/dev/null || true
31 case "$1" in
32 remove)
33 remove_aliases
35 purge)
36 remove_logfile
38 upgrade)
39 if dpkg --compare-versions "$2" gt 1.22.0~ &&
40 dpkg --compare-versions "$2" le 1.22.1; then
41 fixup_systemd_timer
44 failed-upgrade|disappear|abort-install|abort-upgrade)
47 echo "$0 called with unknown argument '$1'" 1>&2
48 exit 1
50 esac
52 #DEBHELPER#
54 exit 0