#!/bin/bash set -e #VARS PACKAGE_NAME=lliurex-wine-common WINE_SETTINGS=/usr/bin/wine CAUTIOUS_SETTINGS=/usr/bin/cautious-launcher LLIUREX_SETTINGS=/usr/share/lliurex-wine/wine LLIUREX_CAUTIOUS_SETTINGS=/usr/share/lliurex-wine/cautious-launcher case $1 in configure) # remove diversion if it was made by another package DIVERTED_PACKAGE="$(dpkg-divert --list "$CAUTIOUS_SETTINGS" |sed -e "s%^.*[[:blank:]]%%")" if [ "$DIVERTED_PACKAGE" ] && [ "$DIVERTED_PACKAGE" != "$PACKAGE_NAME" ] ; then rm -f "${CAUTIOUS_SETTINGS}" dpkg-divert --package $DIVERTED_PACKAGE --rename --quiet --remove "${CAUTIOUS_SETTINGS}" ||true fi if [ ! -f ${CAUTIOUS_SETTINGS}.real ] ; then if dpkg-divert --package $PACKAGE_NAME --rename --quiet --add --divert ${CAUTIOUS_SETTINGS}.real ${CAUTIOUS_SETTINGS} ; then ln -fs ${LLIUREX_CAUTIOUS_SETTINGS} ${CAUTIOUS_SETTINGS} else echo "Unable to divert file \"$CAUTIOUS_SETTINGS\"" >&2 fi fi ;; esac #DEBHELPER# exit 0