r714 - in /trunk/packages/vim/debian: changelog vim-common.postinst vim-common.preinst

jamessan at users.alioth.debian.org jamessan at users.alioth.debian.org
Tue Jun 13 15:08:08 UTC 2006


Author: jamessan
Date: Tue Jun 13 15:08:06 2006
New Revision: 714

URL: http://svn.debian.org/wsvn/pkg-vim/?sc=1&rev=714
Log:
Add vim-common.{pre,post}inst code to handle moving /etc/vim/virc to /etc/vim/vimrc.tiny
Upload to unstable.

Added:
    trunk/packages/vim/debian/vim-common.postinst
Modified:
    trunk/packages/vim/debian/changelog
    trunk/packages/vim/debian/vim-common.preinst

Modified: trunk/packages/vim/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim/debian/changelog?rev=714&op=diff
==============================================================================
--- trunk/packages/vim/debian/changelog (original)
+++ trunk/packages/vim/debian/changelog Tue Jun 13 15:08:06 2006
@@ -1,8 +1,8 @@
-vim (1:7.0-017+6) UNRELEASED; urgency=low
+vim (1:7.0-017+6) unstable; urgency=low
 
   [ Pierre Habouzit ]
   * Add a Replace: vim-runtime to vim-common because of the vimcurrent mess,
-    that may prevent vim upgrade. (Closes: #370012).
+    that may prevent vim upgrade. (Closes: #370012, #373117).
 
   [ James Vega ]
   * Add vim-variant.preinst to remove any cruft left behind in
@@ -12,7 +12,8 @@
     invoked as vi.
     + Move patches/virc.c.diff to debian/tiny/vimrc.tiny.diff and apply only
       when building vim-tiny.
-    + Rename /etc/vim/virc to /etc/vim/vimrc.tiny
+    + Rename /etc/vim/virc to /etc/vim/vimrc.tiny and add
+      vim-common.{post,pre}inst code to handle the conffile renaming.
   * Update README.Debian to specify which package contains the vim policy and
     the correct directory that holds vim policy.
   * Add debchangelog.vim.diff which fixes an inifinite loop bug in the
@@ -20,7 +21,7 @@
   * Add scripts.vim.diff which adds recognition of ltrace output and sets the
     filetype to 'strace'.  (closes: #372926)
 
- -- James Vega <jamessan at debian.org>  Mon, 12 Jun 2006 11:00:05 -0400
+ -- James Vega <jamessan at debian.org>  Tue, 13 Jun 2006 11:06:59 -0400
 
 vim (1:7.0-017+5) unstable; urgency=low
 

Added: trunk/packages/vim/debian/vim-common.postinst
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim/debian/vim-common.postinst?rev=714&op=file
==============================================================================
--- trunk/packages/vim/debian/vim-common.postinst (added)
+++ trunk/packages/vim/debian/vim-common.postinst Tue Jun 13 15:08:06 2006
@@ -1,0 +1,27 @@
+#!/bin/bash -e
+
+LASTVERSION="1:7.0-017+5"
+# Move a conffile without triggering a dpkg question
+mv_conffile() {
+    OLDCONFFILE="$1"
+    NEWCONFFILE="$2"
+
+    if [ -e "$OLDCONFFILE" ]; then
+        echo "Preserving user changes to $NEWCONFFILE ..."
+        mv -f "$NEWCONFFILE" "$NEWCONFFILE".dpkg-new
+        mv -f "$OLDCONFFILE" "$NEWCONFFILE"
+    fi
+}
+
+case "$1" in
+  configure)
+    if dpkg --compare-versions "$2" le "$LASTVERSION"; then
+        mv_conffile "/etc/vim/virc" "/etc/vim/vimrc.tiny"
+    fi
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+

Modified: trunk/packages/vim/debian/vim-common.preinst
URL: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim/debian/vim-common.preinst?rev=714&op=diff
==============================================================================
--- trunk/packages/vim/debian/vim-common.preinst (original)
+++ trunk/packages/vim/debian/vim-common.preinst Tue Jun 13 15:08:06 2006
@@ -6,9 +6,30 @@
   fi
 }
 
+LASTVERSION="1:7.0-017+5"
+prep_mv_conffile() {
+    CONFFILE="$1"
+
+    if [ -e "$CONFFILE" ]; then
+        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
+        old_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
+        if [ "$md5sum" = "$old_md5sum" ]; then
+            rm -f "$CONFFILE"
+        fi
+    fi
+}
+
 case "$1" in
+  install)
+    if dpkg --compare-versions "$2" le "$LASTVERSION"; then
+        prep_mv_conffile "/etc/vim/virc"
+    fi
+    ;;
   upgrade)
     remove_symlink /usr/share/doc/vim-common
+    if dpkg --compare-versions "$2" le "$LASTVERSION"; then
+        prep_mv_conffile "/etc/vim/virc"
+    fi
     ;;
 esac
 




More information about the pkg-vim-maintainers mailing list