File: vim-tcl.preinst

package info (click to toggle)
vim 1%3A7.1.314-3%2Blenny2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 39,856 kB
  • ctags: 25,430
  • sloc: ansic: 279,681; cpp: 3,229; makefile: 2,958; perl: 1,232; sh: 857; awk: 715; xml: 507; cs: 458; asm: 114; python: 28; csh: 6
file content (39 lines) | stat: -rw-r--r-- 1,016 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
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash -e

pkg=vim-tcl
variant=tcl

# check_and_remove_alternative cleans up stale alternatives that were left
# behind from previous mishandling of alternatives.
check_and_remove_alternative () {
  if update-alternatives --list $1 | grep -q bin/vim; then
    for f in `update-alternatives --list $1 | grep 'bin/vim$'`; do
      update-alternatives --remove $1 $f
    done
  fi
}

remove_variant_alternative () {
  for i in vi view ex editor rvim rview vimdiff vim; do
    check_and_remove_alternative $i
    if update-alternatives --list $i | grep -q bin/vim.$variant; then
      update-alternatives --remove $i /usr/bin/vim.$variant
    fi
  done
  remove_gui_variant_alternative
}

remove_gui_variant_alternative () {
  for i in eview evim gview gvimdiff rgview rgvim gvim; do
    check_and_remove_alternative $i
    if update-alternatives --list $i | grep -q bin/vim.$variant; then
      update-alternatives --remove $i /usr/bin/vim.$variant
    fi
  done
}

remove_variant_alternative

#DEBHELPER#

exit 0