#! /bin/sh # # ${R_HOME}/bin/REMOVE for removing add-on packages revision='$Revision: 1.8 $' version=`set - ${revision}; echo ${2}` version="R add-on package remover ${version}" usage="Usage: R REMOVE [options] pkgs Remove the add-on packages specified by pkgs from the default library tree (${R_HOME}/library) or the tree specified via \`--library'. Options: -h, --help print short help message and exit -l, --library=LIB remove packages from library tree LIB -v, --version print version info and exit Report bugs to ." pkgs= lib=${R_HOME}/library while test -n "${1}"; do case ${1} in -h|--help) echo "${usage}"; exit 0 ;; -v|--version) echo "${version}"; exit 0 ;; -l) lib=${2}; shift ;; --library=*) lib=`echo "${1}" | sed -e 's/[^=]*=//'` ;; *) pkgs="${pkgs} ${1}" ;; esac shift done if test -z "${pkgs}"; then echo "ERROR: no packages specified" exit 1 fi if test -d ${lib} -a -w ${lib}; then cd ${lib} lib=`pwd` else echo "ERROR: cannot cd to or remove from directory \`${lib}'" exit 2 fi for pkg in ${pkgs}; do if test -d ${pkg}; then rm -rf ${pkg} else echo "WARNING: there is no pkg \`${pkg}' in lib \`${lib}'" continue fi done cat */TITLE > LibIndex 2> /dev/null NO_PERL5=@NO_PERL5@ if ${NO_PERL5}; then echo "*** Cannot update the file" echo "*** ${lib}/index.html" echo "*** without Perl version 5. Please delete the entries for" echo "*** the packages you removed manually." exit 2 fi if test ${lib} = ${R_HOME}/library; then ${R_HOME}/bin/build-help --htmllists cat ${R_HOME}/library/*/CONTENTS > ${R_HOME}/doc/html/search/index.txt fi ### Local Variables: *** ### mode: sh *** ### sh-indentation: 2 *** ### End: ***