File: vim-runtime.preinst.in

package info (click to toggle)
vim 2%3A9.1.1230-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 87,724 kB
  • sloc: ansic: 416,987; cpp: 6,324; makefile: 4,448; java: 2,226; sh: 1,861; perl: 1,419; python: 960; awk: 730; lisp: 501; cs: 458; objc: 369; xml: 247; sed: 8; csh: 6
file content (27 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (10)
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/sh
set -e

vimcur="@VIMCUR@"
basedir=/usr/share/vim/$vimcur/doc

add_diversion() {
  dpkg-divert --package vim-runtime --add --rename \
    --divert "$1.vim-tiny" "$1"
}

major_upgrade() {
  oldver="${1#?:}"
  oldver="vim$(echo ${oldver%.*-*} | sed 's/\.//g')"
  [ "$oldver" != "$vimcur" ]
}

# Add diversions for any non-upgrade operation or when upgrading across major
# upstream versions.
if [ "$1" != "upgrade" ] || major_upgrade $2; then
  add_diversion $basedir/help.txt
  add_diversion $basedir/tags
fi

#DEBHELPER#

exit 0