From 7489af8695315a4784f840fc9a7573f2ff4c501d Mon Sep 17 00:00:00 2001 From: "Juergen E. Fischer" Date: Fri, 12 Feb 2016 21:18:25 +0100 Subject: [PATCH] debian packaging: fix removed diversion (take II; followup 8b054e6; reverts 5f310a7) --- debian/control.in | 3 +-- debian/qgis.preinst | 23 +++++++++++++++++++++++ debian/qgis.sh.in | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 debian/qgis.preinst diff --git a/debian/control.in b/debian/control.in index 29c5e3e3252c..2fb8609e78ad 100644 --- a/debian/control.in +++ b/debian/control.in @@ -84,8 +84,7 @@ Recommends: qgis-provider-grass, qgis-plugin-globe Suggests: gpsbabel -Replaces: qgis-plugin-grass (<< 1:2.13.0+git20160204) -Conflicts: uim-qt3, qgis-plugin-grass (<< 1:2.13.0+git20160204) +Conflicts: uim-qt3 Description: Geographic Information System (GIS) A Geographic Information System (GIS) manages, analyzes, and displays databases of geographic information. QGIS supports shape file viewing and diff --git a/debian/qgis.preinst b/debian/qgis.preinst new file mode 100644 index 000000000000..392b96212343 --- /dev/null +++ b/debian/qgis.preinst @@ -0,0 +1,23 @@ +#!/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 diff --git a/debian/qgis.sh.in b/debian/qgis.sh.in index 0dcc694fba8b..93ec6a4a0b5f 100644 --- a/debian/qgis.sh.in +++ b/debian/qgis.sh.in @@ -1,6 +1,6 @@ #!/bin/sh -if dpkg -s qgis-plugin-grass >/dev/null; then +if dpkg -s qgis-plugin-grass >/dev/null 2>&1; then if [ "$LD_LIBRARY_PATH" = "" ]; then LD_LIBRARY_PATH=/usr/lib/{GRASS}/lib else @@ -8,7 +8,7 @@ if dpkg -s qgis-plugin-grass >/dev/null; then fi fi -if dpkg -s qgis-oracle-provider >/dev/null; then +if dpkg -s qgis-oracle-provider >/dev/null 2>&1; then if [ "$LD_LIBRARY_PATH" = "" ]; then LD_LIBRARY_PATH={ORACLE_LIBDIR} else