[openstreetmap-carto] 01/01: Use dpkg-maintscript-helper to replace dir with symlink
Ruben Undheim
rubund-guest at moszumanska.debian.org
Wed Oct 14 06:51:38 UTC 2015
This is an automated email from the git hooks/post-receive script.
rubund-guest pushed a commit to branch master
in repository openstreetmap-carto.
commit dc9dff99b9077a09b400b50bf817c4eae6ac5f03
Author: Ruben Undheim <ruben.undheim at gmail.com>
Date: Wed Oct 14 08:44:40 2015 +0200
Use dpkg-maintscript-helper to replace dir with symlink
---
debian/control | 1 +
debian/openstreetmap-carto.postinst | 11 +++++-----
debian/openstreetmap-carto.postrm | 42 +++++++++++++++++++++++++++++++++++++
debian/openstreetmap-carto.preinst | 5 +++++
debian/openstreetmap-carto.prerm | 5 +++++
5 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/debian/control b/debian/control
index 1125c7e..339d285 100644
--- a/debian/control
+++ b/debian/control
@@ -31,6 +31,7 @@ Description: standard OpenStreetMap Mapnik stylesheet
Package: openstreetmap-carto
Architecture: all
+Pre-Depends: dpkg (>= 1.17.14)
Depends: ${misc:Depends},
openstreetmap-carto-common
Description: Setup for standard OpenStreetMap Mapnik stylesheet
diff --git a/debian/openstreetmap-carto.postinst b/debian/openstreetmap-carto.postinst
index 2f15f8d..aad7579 100755
--- a/debian/openstreetmap-carto.postinst
+++ b/debian/openstreetmap-carto.postinst
@@ -14,12 +14,6 @@ case "$1" in
sed -e"s/\[gis\]/\[$RET\]/" /usr/share/openstreetmap-carto-common/style.xml > /usr/share/openstreetmap-carto/style.xml
- # This is necessary in order to replace the dir with a symbolic link since a dir will never be
- # replaced by a symbolic link during upgrade if not done in maintainer scripts.
- if [ -d /usr/share/openstreetmap-carto/symbols ] && [ ! -L /usr/share/openstreetmap-carto/symbols ] ; then
- rmdir /usr/share/openstreetmap-carto/symbols
- ln -sf ../openstreetmap-carto-common/symbols /usr/share/openstreetmap-carto/symbols
- fi
;;
@@ -33,6 +27,11 @@ case "$1" in
esac
+# This is necessary in order to replace the dir with a symbolic link since a dir will never be
+# replaced by a symbolic link during upgrade if not done in maintainer scripts.
+dpkg-maintscript-helper dir_to_symlink /usr/share/openstreetmap-carto/symbols \
+ ../openstreetmap-carto-common/symbols 2.35.0-2 openstreetmap-carto -- "$@"
+
#DEBHELPER#
diff --git a/debian/openstreetmap-carto.postrm b/debian/openstreetmap-carto.postrm
new file mode 100644
index 0000000..445e331
--- /dev/null
+++ b/debian/openstreetmap-carto.postrm
@@ -0,0 +1,42 @@
+#!/bin/sh
+# postrm script for magic
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postrm> `remove'
+# * <postrm> `purge'
+# * <old-postrm> `upgrade' <new-version>
+# * <new-postrm> `failed-upgrade' <old-version>
+# * <new-postrm> `abort-install'
+# * <new-postrm> `abort-install' <old-version>
+# * <new-postrm> `abort-upgrade' <old-version>
+# * <disappearer's-postrm> `disappear' <overwriter>
+# <overwriter-version>
+# for details, see https://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+
+case "$1" in
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear|purge)
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# This is necessary in order to replace the dir with a symbolic link since a dir will never be
+# replaced by a symbolic link during upgrade if not done in maintainer scripts.
+dpkg-maintscript-helper dir_to_symlink /usr/share/openstreetmap-carto/symbols \
+ ../openstreetmap-carto-common/symbols 2.35.0-2 openstreetmap-carto -- "$@"
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/openstreetmap-carto.preinst b/debian/openstreetmap-carto.preinst
index 85fd5b3..93e2dc3 100644
--- a/debian/openstreetmap-carto.preinst
+++ b/debian/openstreetmap-carto.preinst
@@ -30,6 +30,11 @@ case "$1" in
;;
esac
+# This is necessary in order to replace the dir with a symbolic link since a dir will never be
+# replaced by a symbolic link during upgrade if not done in maintainer scripts.
+dpkg-maintscript-helper dir_to_symlink /usr/share/openstreetmap-carto/symbols \
+ ../openstreetmap-carto-common/symbols 2.35.0-2 openstreetmap-carto -- "$@"
+
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
diff --git a/debian/openstreetmap-carto.prerm b/debian/openstreetmap-carto.prerm
index c7ecbac..e9b1d2d 100644
--- a/debian/openstreetmap-carto.prerm
+++ b/debian/openstreetmap-carto.prerm
@@ -34,6 +34,11 @@ case "$1" in
;;
esac
+# This is necessary in order to replace the dir with a symbolic link since a dir will never be
+# replaced by a symbolic link during upgrade if not done in maintainer scripts.
+dpkg-maintscript-helper dir_to_symlink /usr/share/openstreetmap-carto/symbols \
+ ../openstreetmap-carto-common/symbols 2.35.0-2 openstreetmap-carto -- "$@"
+
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/openstreetmap-carto.git
More information about the Pkg-grass-devel
mailing list