#!/bin/sh set -e if [ "$1" = "install" ]; then dpkg-divert --rename --package cryptsetup-nuke-password \ --divert /usr/lib/cryptsetup/askpass.cryptsetup \ --add /usr/lib/cryptsetup/askpass dpkg-divert --rename --package cryptsetup-nuke-password \ --divert /lib/cryptsetup/askpass.cryptsetup.usr-is-merged \ --add /lib/cryptsetup/askpass elif [ "$1" = "upgrade" ]; then TRUENAME=$(dpkg-divert --truename /usr/lib/cryptsetup/askpass) if test "$TRUENAME" = /usr/lib/cryptsetup/askpass.usr-is-merged; then # crypsetup.preinst duplicated the diversion for us dpkg-divert --no-rename --package cryptsetup-nuke-password \ --divert /usr/lib/cryptsetup/askpass.usr-is-merged \ --remove /usr/lib/cryptsetup/askpass dpkg-divert --no-rename --package cryptsetup-nuke-password \ --divert /usr/lib/cryptsetup/askpass.cryptsetup \ --add /usr/lib/cryptsetup/askpass dpkg-divert --no-rename --package cryptsetup-nuke-password \ --remove /lib/cryptsetup/askpass dpkg-divert --no-rename --package cryptsetup-nuke-password \ --divert /lib/cryptsetup/askpass.cryptsetup.usr-is-merged \ --add /lib/cryptsetup/askpass mv "$TRUENAME" /usr/lib/cryptsetup/askpass.cryptsetup elif test "$TRUENAME" != /usr/lib/cryptsetup/askpass.cryptsetup; then dpkg-divert --no-rename --package cryptsetup-nuke-password \ --divert /usr/lib/cryptsetup/askpass.cryptsetup \ --add /usr/lib/cryptsetup/askpass TRUENAME=$(dpkg-divert --truename /lib/cryptsetup/askpass) dpkg-divert --no-rename --package cryptsetup-nuke-password \ --remove /lib/cryptsetup/askpass dpkg-divert --no-rename --package cryptsetup-nuke-password \ --divert /lib/cryptsetup/askpass.cryptsetup.usr-is-merged \ --add /lib/cryptsetup/askpass if test -e "$TRUENAME"; then mv "$TRUENAME" /lib/cryptsetup/askpass.cryptsetup.usr-is-merged fi fi fi #DEBHELPER#