Bug#503757: vim-runtime: 7.2.049-2 is still failing

Matthijs Kooijman matthijs at stdin.nl
Tue Dec 23 13:23:12 UTC 2008


Package: vim-runtime
Version: 1:7.2.049-2
Followup-For: Bug #503757

Hi,

I'm still seeing this problem when upgrading to 7.2.049-2, from
1:7.1.314-3 (I'll call these new and old respectively further on).

I'm not so sure how these diversions really work, though I'll try to
provide some more info.

The exact error I'm seeing is:

	Preparing to replace vim-runtime 1:7.1.314-3 (using .../vim-runtime_2%3a7.2.049-2_all.deb) ...
	Leaving `diversion of /usr/share/vim/vim72/doc/help.txt to /usr/share/vim/vim72/doc/help.txt.vim-tiny by vim-runtime'
	Leaving `diversion of /usr/share/vim/vim72/doc/tags to /usr/share/vim/vim72/doc/tags.vim-tiny by vim-runtime'
	Removing `diversion of /usr/share/vim/vim71/doc/help.txt to /usr/share/vim/vim71/doc/help.txt.vim-tiny by vim-runtime'
	dpkg-divert: rename involves overwriting `/usr/share/vim/vim71/doc/help.txt' with
	  different file `/usr/share/vim/vim71/doc/help.txt.vim-tiny', not allowed

It's interesting to note that (probably due to the conflicts: vim-tiny
that was added) vim-tiny was already (and succesfully) upgraded, but
vim-runtime fails after that.

It seems that diversions are in place for both vim71 and vim72:

	matthijs at xanthe:~$ sudo dpkg-divert --list *vim*
	diversion of /usr/share/vim/vim71/doc/help.txt to /usr/share/vim/vim71/doc/help.txt.vim-tiny by vim-runtime
	diversion of /usr/share/vim/vim71/doc/tags to /usr/share/vim/vim71/doc/tags.vim-tiny by vim-runtime
	diversion of /usr/share/vim/vim72/doc/help.txt to /usr/share/vim/vim72/doc/help.txt.vim-tiny by vim-runtime
	diversion of /usr/share/vim/vim72/doc/tags to /usr/share/vim/vim72/doc/tags.vim-tiny by vim-runtime

I suspect that the vim72 diversions are added by the previous failed
upgrade attempt, from looking at the new preinst script. I also suspect
that the two "Leaving diversion..." messages in the output above are the
attempts to add those diversions again, so it seems these don't pose any
problem.

The new preinst script also tries to remove any old diversions that are
still in place, and this is where things are failing.

Manually executing the remove command confirms that this is indeed the
problem:

	matthijs at xanthe:~$ sudo dpkg-divert --package vim-runtime --rename --remove "/usr/share/vim/vim71/doc/help.txt"
	Removing `diversion of /usr/share/vim/vim71/doc/help.txt to /usr/share/vim/vim71/doc/help.txt.vim-tiny by vim-runtime'
	dpkg-divert: rename involves overwriting `/usr/share/vim/vim71/doc/help.txt' with
	  different file `/usr/share/vim/vim71/doc/help.txt.vim-tiny', not allowed

This does make sense, since the old vim-runtime is still installed (so
/usr/share/vim/vim71/doc/help.txt is present), while there is also still
a /usr/share/vim/vim71/doc/help.txt.vim-tiny.

AFAICS, the latter should have been removed when vim-tiny was upgraded
(I assume that diversions work for removal of files as well as for
installs?). I'm not so sure why that didn't happen, though I'm not so
sure if removing that file is the proper way to handle this.

AFAICU, the diversion should not be removed until after the file is
removed by vim-runtime (ie, in the postinst upgrade and postrm scripts,
I think?). This would also allow vim-runtime to be upgraded when
vim-tiny is still installed, and properly restore
/usr/share/vim/vim71/doc/help.txt to the vim-tiny version.

I did a quick implementation of this scheme (removing the old diversions
in postinst configure, see attachment), which solved my upgrading
problems. This still leaves the vim-tiny versions of help.txt and tags
littering /usr/share/vim/vim71/, but that makes sense, since the cause
of the problem seems to be that the vim-tiny files didn't get removed
properly.

In other words, removing the diversions later makes the vim-runtime
package a lot more robust. Removing any .vim-tiny versions that make
dpkg-divert --remove fail doesn't seem to be the right approach here.

Note that I don't remove the check_diversion function from preinst in
my patch (I don't fully know what it does or why it exists either), but
following the above reasoning I think it might be a bad approach as
well.

I haven't tried reproducing this on a clean environment yet (due to lack
of time), but I'm happy to provide more information if needed.

Gr.

Matthijs

-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.27-rc2-wl-35635-gf8895ad (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

vim-runtime depends on no packages.

Versions of packages vim-runtime recommends:
ii  vim-tiny                     2:7.2.049-2 Vi IMproved - enhanced vi editor -

vim-runtime suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixvim.diff
Type: text/x-diff
Size: 2171 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-vim-maintainers/attachments/20081223/5d62f4ea/attachment.diff 


More information about the pkg-vim-maintainers mailing list