[SCM] Vim packaging branch, maint/lenny, updated. debian/7.1.314-3-51-g209709e
James Vega
jamessan at debian.org
Sun Oct 12 06:29:20 UTC 2008
The following commit has been merged in the maint/lenny branch:
commit b6fde7ac99ff92b8fc4aae04741c78dbe680b3ea
Author: James Vega <jamessan at debian.org>
Date: Fri Oct 10 00:22:09 2008 -0400
Fix a bug related to diversions and vim-runtime Replacing vim-tiny
There are two situations to consider:
1) Upgrading from a vim-runtime package which Replaces vim-tiny to one that
provides diversions for the conflicting files. In this case, simply
removing doc/help.txt and doc/tags before setting up the diversion prevents
the problem from happening.
2) Upgrading a package that already has the problem (of
{help.txt,tags}.vim-tiny being the same as {help.txt,tags}). In this
scenario, we detect the situation and remove the diverted (.vim-tiny)
files.
Signed-off-by: James Vega <jamessan at debian.org>
Conflicts:
debian/vim-runtime.preinst.in
Signed-off-by: James Vega <jamessan at debian.org>
diff --git a/debian/vim-runtime.preinst.in b/debian/vim-runtime.preinst.in
index b202e3f..dacda44 100644
--- a/debian/vim-runtime.preinst.in
+++ b/debian/vim-runtime.preinst.in
@@ -3,6 +3,27 @@ set -e
basedir=/usr/share/vim/@VIMCUR@/doc
+# If we're upgrading from a version that had "vim-runtime Replaces vim-tiny"
+# and diversions haven't been setup, remove help.txt and tags to ensure
+# diversions get setup properly.
+#
+# OTOH, if we already have diversions setup, we may have a situation where
+# vim-tiny isn't installed but help.txt and tags have been diverted. In that
+# case, remove the diverted files as they don't belong.
+check_diversion() {
+ if dpkg --compare-versions "$1" ge "1:7.1-056+1" \
+ && dpkg --compare-versions "$1" lt "1:7.1.314-1"; then
+ rm -f /usr/share/vim/vim71/doc/tags
+ rm -f /usr/share/vim/vim71/doc/help.txt
+ elif dpkg --compare-versions "$1" ge "1:7.1.314-1"; then
+ inst=$(dpkg-query -W -f='${Status}\n' vim-tiny | awk '{print $1}')
+ if [ "$inst" != "install" ]; then
+ rm -f /usr/share/vim/vim71/doc/tags.vim-tiny
+ rm -f /usr/share/vim/vim71/doc/help.txt.vim-tiny
+ fi
+ fi
+}
+
add_diversion() {
dpkg-divert --package vim-runtime --add --rename \
--divert "$1.vim-tiny" "$1"
@@ -13,6 +34,9 @@ add_diversion() {
# to a new major upstream version as well to handle removing the diversions in
# previous versioned directories.
if [ "$1" = "install" ] || [ "$1" = "upgrade" ]; then
+ if [ "$1" = "upgrade" ]; then
+ check_diversion "$2"
+ fi
add_diversion $basedir/help.txt
add_diversion $basedir/tags
fi
--
Vim packaging
More information about the pkg-vim-maintainers
mailing list