File: vim.preinst

package info (click to toggle)
vim 6.1.018-1woody1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 18,144 kB
  • ctags: 13,404
  • sloc: ansic: 171,869; makefile: 2,680; perl: 1,022; awk: 700; sh: 546; csh: 6
file content (26 lines) | stat: -rw-r--r-- 406 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#! /bin/sh

# Abort on errors
set -e

movecfgfile() {
	if [ -e "/etc/$1" ] ; then
		echo -n "Moving $1"
		mv "/etc/$1" "/etc/vim/"
		echo
	fi
}

# If we are upgrading we might need to move configfiles
if [ "$1" = "upgrade" ] ;  then
	if [ ! -d /etc/vim ] ; then
		echo "Moving configuration files to /etc/vim."
		mkdir /etc/vim
		chmod 755 /etc/vim
		movecfgfile vimrc
		movecfgfile gvimrc
	fi
fi

exit 0