r422 - trunk/vim/debian

Stefano Zacchiroli zack at costa.debian.org
Fri Dec 2 08:59:33 UTC 2005


Author: zack
Date: 2005-12-02 08:59:33 +0000 (Fri, 02 Dec 2005)
New Revision: 422

Modified:
   trunk/vim/debian/vim-variant.postinst
   trunk/vim/debian/vim-variant.prerm
Log:
different gnome-text-editor alternative priorities for vim-full and vim-gnome


Modified: trunk/vim/debian/vim-variant.postinst
===================================================================
--- trunk/vim/debian/vim-variant.postinst	2005-12-01 22:32:06 UTC (rev 421)
+++ trunk/vim/debian/vim-variant.postinst	2005-12-02 08:59:33 UTC (rev 422)
@@ -2,53 +2,57 @@
 
 pkg=@PKG@
 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
+# 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 40
+      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)
-      	prio=40
+	add_variant_alternative 40
 	;;
-      vim-gnome)
-      	prio=40
-	add_gnome_alternative
+      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
-	add_gnome_alternative
+      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-variant.prerm
===================================================================
--- trunk/vim/debian/vim-variant.prerm	2005-12-01 22:32:06 UTC (rev 421)
+++ trunk/vim/debian/vim-variant.prerm	2005-12-02 08:59:33 UTC (rev 422)
@@ -17,7 +17,7 @@
 case "$1" in
   remove)
     case "$pkg" in
-      vim-gnome|vim-full)
+      vim-gnome|vim-full) # gnome enabled variants
         remove_gnome_alternative
 	;;
     esac




More information about the pkg-vim-maintainers mailing list