#!/bin/sh # Early versions of the xchpst package considered the dpkg-divert and # update-alternatives mechanisms to provide a way of offering compat # for xchpst when xchpst is not available. This mechanism was never # used by another package and the runit package chose to offer an # arrangement involving environment variables, so the alternatives can # can now be retired. https://bugs.debian.org/1093545 set -e undivert () { local from="$1" local to="$2" [ -z "$(dpkg-divert --list $from)" ] || dpkg-divert --rename \ --package xchpst --divert "$to" --remove "$from" } # Unconditionally remove dpkg diversion undivert /usr/bin/xchpst /usr/bin/xchpst.fake undivert \ /usr/share/man/man8/xchpst.8.gz \ /usr/share/man/man8/xchpst.fake.8.gz # Unconditionally remove 'alternatives' update-alternatives --remove-all xchpst 2>/dev/null || true