#!/bin/sh set -e # summary of how this script can be called: # # * `install' # * `install' # * `upgrade' # * `abort-upgrade' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package create_protective_diversion() { local usrfile="$1" local firstver="$2" if [ "$3" != "--" ]; then echo "create_protective_diversion called with the wrong number of arguments" >&2 return 1 fi for _ in $(seq 1 3); do shift done # If we're upgrading from a new enough version of the package, it means # that usr-merge has already happened and we don't need to mess with # diversions at all if [ -n "$2" ] && dpkg --compare-versions -- "$2" gt "$firstver"; then return 0 fi dpkg-divert \ --no-rename \ --divert "$usrfile.usr-is-merged" \ --add "$usrfile" } DAEMON_COMMON_UNITS=" libvirt-guests.service virt-guest-shutdown.target " case "$1" in install|upgrade) for unit in $DAEMON_COMMON_UNITS; do create_protective_diversion \ "/lib/systemd/system/$unit" \ "10.6.0-3~" \ -- \ "$@" done ;; abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # Automatically added by dh_installinit/13.24.2 if [ "$1" = "install" ] && [ -n "$2" ] && [ -e "/etc/init.d/libvirt-guests" ] ; then chmod +x "/etc/init.d/libvirt-guests" >/dev/null || true fi # End automatically added section exit 0