#!/bin/sh
#
# postinst script for the Debian GNU/Linux r-extras package
#
# This version written by Douglas Bates <bates@stat.wisc.edu>

set -e

case "$1" in
  remove)
    if [ -d /usr/lib/R/library ]; then
      (cd /usr/lib/R/library;
      cat */TITLE > LibIndex;
      ../etc/build-help --htmllist)
    fi
    ;;

  purge)
    if [ -d /usr/lib/R/library ]; then
      (cd /usr/lib/R/library;
      cat */TITLE > LibIndex;
      ../etc/build-help --htmllist)
    fi
    ;;

  upgrade)
    ;;

  failed-upgrade|abort-install|abort-upgrade|disappear)
    ;;

  *)
    echo "postrm called with unknown argument \`$1'" >&2
    ;;
esac

exit 0
