On 18 Apr 2002, Guillaume Cottenceau wrote:
> Since:
>
> [gc@bi ~] ls -l /usr/share/vim/lang
> lrwxrwxrwx 1 root root 17 Apr 3 05:22 /usr/share/vim/lang ->
>/usr/share/locale/
>
> And now:
>
> [gc@bi ~] rpm -qplv /RPMS/vim-common-6.1-4mdk.i586.rpm | grep /usr/share/vim/lang$
> drwxr-xr-x 2 root root 0 Apr 17 18:43 /usr/share/vim/lang
>
> Installing vim-common-6.1-4mdk screwed up all my
> /usr/share/locale directory (thx Titi).
Luckily I stopped when urpmi complains about conflict between
vim and locales-*. Otherwise all my customized translations will
be burned in hell as well. Such changes ought to put into
real machine testing before releasing.
Attached a patch to check carefully whether $datadir/vim/lang
is a real directory before removing it.
Besides, I remembered somebody suggested to keep /bin/vi link
to /bin/vim-minimal forever, so that one can still use vi if
/usr is not mounted. Is it acceptable?
--
Abel Cheung
GPG Key: (0xC67186FF) http://deaddog.org/gpg.asc
--- vim.spec 2002-04-18 00:42:58.000000000 +0800
+++ vim.spec.new 2002-04-18 17:59:18.000000000 +0800
@@ -268,7 +268,11 @@
# So we've to symlink locales there
# But to prevent update faillure, we must first be sure a link
# creation won't fail because old directory is still there
-rm -fr %_datadir/vim/lang/*/||:
+if test -d %{_datadir}/vim/lang -a ! -L %{_datadir}/vim/lang; then
+ rm -fr %{_datadir}/vim/lang
+else
+ rm -f %{_datadir}/vim/lang
+fi
%post minimal
update-alternatives --install /bin/vi vi /bin/vim-minimal 10