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
|