Filewatcher File Search
FTP Search
  
Directory (beta)
  
Content Search (beta)
   
pkg://vim-gnome_7.0-122+1etch3_i386.deb:868016/preinst  info  downloads

#!/bin/bash -e

pkg=vim-gnome
variant=gnome

remove_directory () {
  if [ -d $1 ]; then
    rm -rf $1
  fi
}

remove_variant_alternative () {
  for i in vi view ex editor; do
    update-alternatives --remove $i /usr/bin/vim.$variant
  done
}

remove_old_diversion () {
  if [ -f /usr/bin/vim.org -o \( -e /usr/bin/vim -a \! -L /usr/bin/vim \) ]; then
    # We need to remove the actual vim binary in order to remove the diversion.
    # This is normally done during postrm when removing the package, but since
    # we're upgrading to a package with alternatives we have to manually
    # perform the removal.
    rm -f /usr/bin/vim
    dpkg-divert --package $pkg --remove --rename \
      --divert /usr/bin/vim.org /usr/bin/vim
  fi
}

# 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
}

case "$1" in
  upgrade)
    for i in vi view ex editor; do
      check_and_remove_alternative $i
    done
    remove_directory /usr/share/doc/$pkg
    [ -e /usr/share/man/ru.UTF-8/man1/vim.1.gz ] && remove_variant_alternative
    remove_old_diversion
    ;;
esac



exit 0
Results 1 - 1
Help - FTP Sites List - Software Dir.
Searching half a billion files worldwide
© 1997-2008 IT MARUHN