diff options
Diffstat (limited to 'patches/source/vim/doinst.sh')
-rw-r--r-- | patches/source/vim/doinst.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/patches/source/vim/doinst.sh b/patches/source/vim/doinst.sh new file mode 100644 index 000000000..ebb76cc20 --- /dev/null +++ b/patches/source/vim/doinst.sh @@ -0,0 +1,25 @@ +#!/bin/bash +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} +config usr/share/vim/vimrc.new + +# Responding to a report that in some cases the file +# /usr/share/vim/vim90/defaults.vim must be edited in order to change settings +# (some settings in the file will otherwise override those in +# /usr/share/vim/vimrc), we will support a file in the same directory named +# defaults.vim.custom. If this file exists, then it will replace the shipped +# version of defaults.vim. The original file will be preserved as +# defaults.vim.orig. +if [ -r usr/share/vim/vim90/defaults.vim.custom ]; then + cp -a usr/share/vim/vim90/defaults.vim usr/share/vim/vim90/defaults.vim.orig + cp -a usr/share/vim/vim90/defaults.vim.custom usr/share/vim/vim90/defaults.vim +fi |