1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00
Files
CumulusNetworks-ifupdown2/ifupdown2/debian/python-ifupdown2.preinst
Sam Tannous 6b14b64e62 Fixed new file addition breakage with 0b762139
This patch moved policymanager.py and python-ifupdown2.preinst
to their correct locations.   A previous patch incorrectly added
these files to the wrong path.
2015-06-22 13:07:00 -04:00

57 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# preinst script for newpkg
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <new-preinst> `install'
# * <new-preinst> `install' <old-version>
# * <new-preinst> `upgrade' <old-version>
# * <old-preinst> `abort-upgrade' <new-version>
# 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