summaryrefslogtreecommitdiffstats
path: root/debian/vim-runtime.postrm.in
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:09:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 20:09:22 +0000
commit832763f29065b614443252446be7580a952acb24 (patch)
treee26bb02a9e72cd510f6085fbc13846931f0209cf /debian/vim-runtime.postrm.in
parentAdding upstream version 2:9.1.0016. (diff)
downloadvim-832763f29065b614443252446be7580a952acb24.tar.xz
vim-832763f29065b614443252446be7580a952acb24.zip
Adding debian version 2:9.1.0016-1.debian/2%9.1.0016-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--debian/vim-runtime.postrm.in28
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/vim-runtime.postrm.in b/debian/vim-runtime.postrm.in
new file mode 100644
index 0000000..6536648
--- /dev/null
+++ b/debian/vim-runtime.postrm.in
@@ -0,0 +1,28 @@
+#!/bin/sh
+set -e
+
+vimcur="@VIMCUR@"
+basedir=/usr/share/vim/$vimcur/doc
+
+rm_diversion() {
+ dpkg-divert --package vim-runtime --rename --remove "$1"
+}
+
+# When upgrading to a new major upstream release, we need to remove the old
+# vim-tiny help(tags) diversions
+major_upgrade() {
+ newver="${1#?:}"
+ newver="vim$(echo ${newver%.*-*} | sed 's/\.//g')"
+ [ "$newver" != "$vimcur" ]
+}
+
+rm -f /usr/share/vim/addons/doc/tags
+if [ "$1" = "remove" -o "$1" = "abort-install" -o "$1" = "disappear" ] \
+ || ([ "$1" = "upgrade" ] && major_upgrade $2); then
+ rm_diversion $basedir/help.txt
+ rm_diversion $basedir/tags
+fi
+
+#DEBHELPER#
+
+exit 0