r421 - trunk/vim/debian

Stefano Zacchiroli zack at costa.debian.org
Thu Dec 1 22:32:07 UTC 2005


Author: zack
Date: 2005-12-01 22:32:06 +0000 (Thu, 01 Dec 2005)
New Revision: 421

Modified:
   trunk/vim/debian/changelog
   trunk/vim/debian/vim-variant.postinst
   trunk/vim/debian/vim-variant.prerm
Log:
gnome enabled variants as alternative for gnome-text-editor


Modified: trunk/vim/debian/changelog
===================================================================
--- trunk/vim/debian/changelog	2005-12-01 22:06:33 UTC (rev 420)
+++ trunk/vim/debian/changelog	2005-12-01 22:32:06 UTC (rev 421)
@@ -26,6 +26,8 @@
   * Updated Description-s in debian/control.
   * Check for and removal of old vim.org diversion in postinst instead
     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)
 
   [ James Vega ]
   * Added patch 148_debchangelog, update syntax/debchangelog.vim to

Modified: trunk/vim/debian/vim-variant.postinst
===================================================================
--- trunk/vim/debian/vim-variant.postinst	2005-12-01 22:06:33 UTC (rev 420)
+++ trunk/vim/debian/vim-variant.postinst	2005-12-01 22:32:06 UTC (rev 421)
@@ -4,6 +4,11 @@
 variant=@VARIANT@
 prio=0
 
+# two things to do:
+# 1) add /usr/bin/vim.variant as alternative for /usr/bin/vim
+# 2) add /usr/bin/gvim as an alternative for gnome-text-editor for
+#    variants built with gnome support
+
 remove_old_diversion() {
   if [ -f /usr/bin/vim.org ]; then
     dpkg-divert --package $pkg --remove --rename \
@@ -11,6 +16,13 @@
   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 40
+  fi
+}
+
 case "$1" in
   configure)
     remove_old_diversion
@@ -21,18 +33,22 @@
       vim)
 	prio=20
 	;;
-      vim-gtk|vim-lesstif|vim-gnome)
+      vim-gtk|vim-lesstif)
       	prio=40
 	;;
+      vim-gnome)
+      	prio=40
+	add_gnome_alternative
+	;;
       vim-perl|vim-python|vim-ruby|vim-tcl)
         prio=50
 	;;
       vim-full)
         prio=60
+	add_gnome_alternative
 	;;
     esac
-    update-alternatives \
-      --install /usr/bin/vim vim /usr/bin/vim.$variant $prio
+    update-alternatives --install /usr/bin/vim vim /usr/bin/vim.$variant $prio
     ;;
 esac
 

Modified: trunk/vim/debian/vim-variant.prerm
===================================================================
--- trunk/vim/debian/vim-variant.prerm	2005-12-01 22:06:33 UTC (rev 420)
+++ trunk/vim/debian/vim-variant.prerm	2005-12-01 22:32:06 UTC (rev 421)
@@ -3,8 +3,25 @@
 pkg=@PKG@
 variant=@VARIANT@
 
+# 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)
+        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