[SCM] Vim packaging branch, debian, updated. upstream/7.1.285-116-g3a3a926
James Vega
jamessan at debian.org
Sun May 25 15:13:02 UTC 2008
The following commit has been merged in the debian branch:
commit 3a3a9264a5c5d4f074351f6efd8895af1e6ad367
Author: James Vega <jamessan at debian.org>
Date: Fri May 23 18:07:35 2008 -0400
Add a diversion for doc/tags and handle upgrades from Replaced packages.
Signed-off-by: James Vega <jamessan at debian.org>
diff --git a/debian/vim-runtime.postrm.in b/debian/vim-runtime.postrm.in
index b34b2e3..c1dcea9 100644
--- a/debian/vim-runtime.postrm.in
+++ b/debian/vim-runtime.postrm.in
@@ -4,7 +4,9 @@ case "$1" in
remove)
rm -f /usr/share/vim/addons/doc/tags
dpkg-divert --package vim-runtime --rename --remove \
- /usr/share/vim/@VIMCUR@/doc/help.txt
+ /usr/share/vim/@VIMCUR@/doc/help.txt
+ dpkg-divert --package vim-runtime --rename --remove \
+ /usr/share/vim/@VIMCUR@/doc/tags
;;
esac
diff --git a/debian/vim-runtime.preinst.in b/debian/vim-runtime.preinst.in
index 11b600f..62df1d7 100644
--- a/debian/vim-runtime.preinst.in
+++ b/debian/vim-runtime.preinst.in
@@ -2,20 +2,28 @@
set -e
basedir=/usr/share/vim/@VIMCUR@
+
+# If a diversion isn't setup yet, remove the current file which will be
+# diverted to ensure that we don't divert the wrong file.
+check_diversion() {
+ if ! dpkg-divert --list | grep -q "$1" >/dev/null 2>&1; then
+ [ ! -f "$1" ] || rm -f "$1"
+ dpkg-divert --package vim-runtime --add --rename \
+ --divert "$1.tiny" "$1"
+ fi
+}
+
case "$1" in
- install)
- dpkg-divert --package vim-runtime --add --rename \
- --divert $basedir/doc/help.txt.tiny $basedir/doc/help.txt
- ;;
- # Only needed to handle people that had previously used a vim-runtime
- # which Replaces: vim-tiny
- upgrade)
- if ! dpkg-divert --list | grep -q $basedir/doc/help.txt.tiny >/dev/null 2>&1; then
- [ -f $basedir/doc/help.txt ] || rm $basedir/doc/help.txt
- dpkg-divert --package vim-runtime --add --rename \
- --divert $basedir/doc/help.txt.tiny $basedir/doc/help.txt
- fi
- ;;
+ install)
+ dpkg-divert --package vim-runtime --add --rename \
+ --divert $basedir/doc/help.txt.tiny $basedir/doc/help.txt
+ dpkg-divert --package vim-runtime --add --rename \
+ --divert $basedir/doc/tags.tiny $basedir/doc/tags
+ ;;
+ upgrade)
+ check_diversion $basedir/doc/help.txt
+ check_diversion $basedir/doc/tags
+ ;;
esac
#DEBHELPER#
--
Vim packaging
More information about the pkg-vim-maintainers
mailing list