File: vim-common.postinst

package info (click to toggle)
vim 1%3A7.0-122%2B1etch5
  • links: PTS
  • area: main
  • in suites: etch
  • size: 9,992 kB
  • ctags: 55
  • sloc: makefile: 444; sh: 224; perl: 97; python: 25
file content (27 lines) | stat: -rw-r--r-- 540 bytes parent folder | download | duplicates (2)
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
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