#!/bin/sh set -e # summary of how this script can be called: # # * `remove' # * `purge' # * `upgrade' # * `disappear' # * `failed-upgrade' # * `abort-install' # * `abort-install' # * `abort-upgrade' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package delete_protective_diversion() { local usrfile="$1" local firstver="$2" if [ "$3" != "--" ]; then echo "delete_protective_diversion called with the wrong number of arguments" >&2 return 1 fi for _ in $(seq 1 3); do shift done # If the diversion doesn't exist there's nothing to clean up if [ -z "$(dpkg-divert --list "$usrfile")" ]; then return 0 fi dpkg-divert \ --no-rename \ --divert "$usrfile.usr-is-merged" \ --remove "$usrfile" } DAEMON_LOCK_UNITS=" virtlockd-admin.socket virtlockd.service virtlockd.socket " case "$1" in failed-upgrade|abort-install|abort-upgrade) for unit in $DAEMON_LOCK_UNITS; do delete_protective_diversion \ "/lib/systemd/system/$unit" \ "10.6.0-3~" \ -- \ "$@" done ;; remove|purge|upgrade|disappear) ;; *) echo "postrm called with unknown argument \`$1'" >&2 exit 1 ;; esac # Automatically added by dh_installsystemd/13.24.2 if [ "$1" = remove ] && [ -d /run/systemd/system ] ; then systemctl --system daemon-reload >/dev/null || true fi # End automatically added section # Automatically added by dh_installsystemd/13.24.2 if [ "$1" = "purge" ]; then if [ -x "/usr/bin/deb-systemd-helper" ]; then deb-systemd-helper purge 'virtlockd-admin.socket' 'virtlockd.service' 'virtlockd.socket' >/dev/null || true fi fi # End automatically added section exit 0