QGIS/debian/qgis.preinst

24 lines
696 B
Plaintext
Raw Normal View History

#!/bin/sh
set -e
if [ "$1" = "install" -o "$1" = "upgrade" ]; then
# Fix bad diversions
div=$(dpkg-divert --listpackage /usr/bin/qgis)
if [ -n "$div" -a "$div" = qgis-plugin-grass ]; then
for i in /usr/bin/qgis /usr/bin/qbrowser; do
if [ -e $i ] && ! [ -e $i.undiverted ]; then
mv $i $i.undiverted
fi
dpkg-divert --package qgis-plugin-grass --remove --rename --divert $i.bin $i
if [ -e $i.undiverted ]; then
mv $i.undiverted $i
fi
done
fi
fi
#DEBHELPER#
exit 0