/etc/vim/vimrc: syntax on fix; update in debian/preinst 0.2.19
authorMichael Prokop <mika@grml.org>
Fri, 9 Feb 2007 14:25:27 +0000 (15:25 +0100)
committerMichael Prokop <mika@grml.org>
Fri, 9 Feb 2007 14:25:27 +0000 (15:25 +0100)
debian/changelog
debian/preinst
etc/vim/vimrc

index 4e16bd7..28f9941 100644 (file)
@@ -1,3 +1,12 @@
+grml-etc-core (0.2.19) unstable; urgency=low
+
+  * /etc/vim/vimrc: make sure we use 'syntax on' only when we
+    have vim with +syntax
+  * debian/preinst: another fix to improve keeping of original
+    configuration files
+
+ -- Michael Prokop <mika@grml.org>  Fri,  9 Feb 2007 15:24:14 +0100
+
 grml-etc-core (0.2.18) unstable; urgency=low
 
   * /etc/zsh/completion.d/grml-wallpaper: allow proper setting
index 43ccd68..848ecff 100755 (executable)
@@ -4,7 +4,7 @@
 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 # Bug-Reports:   see http://grml.org/bugs/
 # License:       This file is licensed under the GPL v2.
-# Latest change: Die Okt 03 20:33:19 CEST 2006 [mika]
+# Latest change: Fre Feb 09 15:24:01 CET 2007 [mika]
 ################################################################################
 
 set -e
@@ -18,21 +18,24 @@ divert_conffile() {
        cp -f "$CONFFILE" "$CONFFILE".original
     else
        [ -e "$CONFFILE" ] && cp -f "$CONFFILE" "$CONFFILE".grml-etc-core
-#       [ -e "$CONFFILE" ] && cp -f "$CONFFILE" "$CONFFILE".original
     fi
+
 }
 
 case "$1" in
    install|upgrade|configure)
+        TMP=$$
         # move files from package grml-etc to grml-etc-core, make sure
         # we don't lose any files...
         for file in /etc/zsh/zlogin /etc/zsh/zprofile /etc/zsh/zshenv /etc/zsh/zshrc \
                     /etc/zsh/zlogout /etc/vim/vimrc; do
+               [ -e "$file".original ] || cp -f "$file" "${file}.tmp.$$"
                divert_conffile $file && \
                [ -f "$file" ] && rm $file && \
                dpkg-divert --quiet --add --rename --package grml-etc-core --divert "$file".original $file  && \
                [ -f "$file".dpkg-bak ]      && mv -f "$file".dpkg-bak "$file"
                [ -f "$file".grml-etc-core ] && mv -f "$file".grml-etc-core "$file"
+              [ -e "${file}.tmp.$$" ]      && mv -f "${file}.tmp.$$" "$file.original"
 
                # trying to overwrite `/etc/skel/.zshrc', which is also in package zsh
                # [ -f /etc/skel/.zshrc ] && \
index 5cac7a6..838cacc 100644 (file)
@@ -3,7 +3,7 @@
 " Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
 " Bug-Reports:   see http://grml.org/bugs/
 " License:       This file is licensed under the GPL v2.
-" Latest change: Son Nov 19 15:26:34 CET 2006 [mika]
+" Latest change: Fre Feb 09 14:32:09 CET 2007 [mika]
 """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
 
 " All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
@@ -48,9 +48,11 @@ set suffixes=.bak,~,.swp,.o,.info,.aux,.log,.dvi,.bbl,.blg,.brf,.cb,.ind,.idx,.i
 " Make p in Visual mode replace the selected text with the "" register.
 vnoremap p <Esc>:let current_reg = @"<CR>gvdi<C-R>=current_reg<CR><Esc>
 
-" Vim5 and later versions support syntax highlighting. Uncommenting the next
-" line enables syntax highlighting by default.
-syntax on
+" Vim5 and later versions support syntax highlighting.
+" Just load the main syntax file when Vim was compiled with "+syntax".
+  if has("syntax")
+     syntax on
+  fi
 
 " Debian uses compressed helpfiles. We must inform vim that the main
 " helpfiles is compressed. Other helpfiles are stated in the tags-file.