#!/bin/sh # preinst script for newpkg # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `install' # * `install' # * `upgrade' # * `abort-upgrade' # for details, see http://www.debian.org/doc/debian-policy/ or # the debian-policy package preinst_upgrade() { local oldver="$1" local udev_user_rulesdir="/etc/udev/rules.d" # we have to fixup the filesystem here as previous packages of # ifupdown2 introduced a bug in the postrm script that require # these files to exist, otherwise the postrm script will always # fail. local badver="0.1-cl2.5+2" if dpkg --compare-versions "${oldver}" "lt" "${badver}"; then local files="${udev_user_rulesdir}/80-networking.rules ${udev_user_rulesdir}/60-bridge-network-interface.rules" for f in ${files}; do echo "touching udev rule: ${f}" test ! -e "${f}" && ln -s /dev/null "${f}" || \ /bin/echo -e "\tudev rule exists leaving" done fi } case "$1" in install|upgrade) preinst_upgrade "$2" ;; abort-upgrade) ;; *) echo "preinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # dh_installdeb will replace this with shell code automatically # generated by other debhelper scripts. #DEBHELPER# exit 0