r425 - trunk/vim/debian
Stefano Zacchiroli
zack at costa.debian.org
Mon Dec 5 08:23:39 UTC 2005
Author: zack
Date: 2005-12-05 08:23:38 +0000 (Mon, 05 Dec 2005)
New Revision: 425
Modified:
trunk/vim/debian/changelog
trunk/vim/debian/vim-gui-common.menu
trunk/vim/debian/vim.postinst
trunk/vim/debian/vim.prerm
Log:
- gnome-text-editor alternative (pending commit)
- fixed unsubstituted @PKG@ in menu entry
Modified: trunk/vim/debian/changelog
===================================================================
--- trunk/vim/debian/changelog 2005-12-02 21:42:44 UTC (rev 424)
+++ trunk/vim/debian/changelog 2005-12-05 08:23:38 UTC (rev 425)
@@ -28,6 +28,7 @@
of postrm (closes: #341081)
* Adds gvim, when compiled with gnome support, as an alternative for
gnome-text-editor, with priority lower than gedit (closes: #287202)
+ * Substituted @PKG@ in menu entry for package name (closes: #342074)
[ James Vega ]
* Added patch 148_debchangelog, update syntax/debchangelog.vim to
Modified: trunk/vim/debian/vim-gui-common.menu
===================================================================
--- trunk/vim/debian/vim-gui-common.menu 2005-12-02 21:42:44 UTC (rev 424)
+++ trunk/vim/debian/vim-gui-common.menu 2005-12-05 08:23:38 UTC (rev 425)
@@ -1,6 +1,6 @@
-?package(@PKG@):needs="x11" \
+?package(vim-gui-common):needs="x11" \
section="Apps/Editors" \
- title="GVIM" \
+ title="GVIM" \
longtitle="GVIM, graphical Vi IMproved" \
command="/usr/bin/gvim -f" \
icon="/usr/share/pixmaps/vim-32.xpm" \
Modified: trunk/vim/debian/vim.postinst
===================================================================
--- trunk/vim/debian/vim.postinst 2005-12-02 21:42:44 UTC (rev 424)
+++ trunk/vim/debian/vim.postinst 2005-12-05 08:23:38 UTC (rev 425)
@@ -2,36 +2,57 @@
pkg=vim
variant=basic
-prio=0
+# two things to do:
+# 1) add /usr/bin/vim.variant as alternative for /usr/bin/vim. Priority are
+# chosen accordingly to the principle: ``more features, higher priority''
+# 2) add /usr/bin/gvim as an alternative for gnome-text-editor for variants
+# built with gnome support. Same principle for the priority above, with the
+# additional constraint that priority should not be higher than gedit's
+
remove_old_diversion() {
if [ -f /usr/bin/vim.org ]; then
dpkg-divert --package $pkg --remove --rename \
- --divert /usr/bin/vim.org /usr/bin/vim
+ --divert /usr/bin/vim.org /usr/bin/vim
fi
}
+add_gnome_alternative() {
+ if [ -f /usr/bin/gvim ]; then
+ update-alternatives --install /usr/bin/gnome-text-editor \
+ gnome-text-editor /usr/bin/vim.$variant $1
+ fi
+}
+
+add_variant_alternative() {
+ update-alternatives --install /usr/bin/vim vim /usr/bin/vim.$variant $1
+}
+
case "$1" in
configure)
remove_old_diversion
case "$pkg" in
vim-tiny)
- prio=10
+ add_variant_alternative 10
;;
vim)
- prio=20
+ add_variant_alternative 20
;;
- vim-gtk|vim-lesstif|vim-gnome)
- prio=40
+ vim-gtk|vim-lesstif)
+ add_variant_alternative 40
;;
+ vim-gnome) # gnome enabled variant
+ add_variant_alternative 40
+ add_gnome_alternative 40
+ ;;
vim-perl|vim-python|vim-ruby|vim-tcl)
- prio=50
+ add_variant_alternative 50
;;
- vim-full)
- prio=60
+ vim-full) # gnome enabled variant
+ add_variant_alternative 60
+ add_gnome_alternative 45
;;
esac
- update-alternatives --install /usr/bin/vim vim /usr/bin/vim.$variant $prio
;;
esac
Modified: trunk/vim/debian/vim.prerm
===================================================================
--- trunk/vim/debian/vim.prerm 2005-12-02 21:42:44 UTC (rev 424)
+++ trunk/vim/debian/vim.prerm 2005-12-05 08:23:38 UTC (rev 425)
@@ -3,8 +3,25 @@
pkg=vim
variant=basic
+# two things to do:
+# 1) remove /usr/bin/vim.variant as alternative for /usr/bin/vim
+# 2) remove /usr/bin/gvim as an alternative for gnome-text-editor for
+# variants built with gnome support
+
+remove_gnome_alternative() {
+ if [ -f /usr/bin/gvim ]; then
+ update-alternatives --remove gnome-text-editor /usr/bin/vim.$variant
+ fi
+}
+
case "$1" in
remove)
+ case "$pkg" in
+ vim-gnome|vim-full) # gnome enabled variants
+ remove_gnome_alternative
+ ;;
+ esac
+ remove_gnome_alternative
update-alternatives --remove vim /usr/bin/vim.$variant
;;
esac
More information about the pkg-vim-maintainers
mailing list