#! /bin/sh
#
# ${R_HOME}/bin/INSTALL for installing add-on packages

# src/scripts/INSTALL.  Generated from INSTALL.in by configure.

## Trap interrupts, most importantly 2 (^C from keyboard)
trap do_exit_on_error 1 2 15

revision='$Rev: 45602 $'
version=`set - ${revision}; echo ${2}`
version="R add-on package installer ${version}

Copyright (C) 2000-2007 The R Core Development Team.
This is free software; see the GNU General Public License version 2
or later for copying conditions.  There is NO warranty."

usage="Usage: R CMD INSTALL [options] pkgs

Install the add-on packages specified by pkgs.  The elements of pkgs can
be relative or absolute paths to directories with the package (bundle)
sources, or to gzipped package 'tar' archives.  The library tree to
install to can be specified via '--library'.  By default, packages are
installed in the library tree rooted at the first directory in
.libPaths() for an R session run in the current environment

Options:
  -h, --help		print short help message and exit
  -v, --version		print INSTALL version info and exit
      --configure-args=ARGS
                        set arguments for the package's configure script
			(if any)
      --configure-vars=VARS
                        set variables for the configure script (if any)
  -c, --clean		remove files created during installation
      --preclean	remove files created during a previous run
  -d, --debug		turn on shell and build-help debugging
  -l, --library=LIB	install packages to library tree LIB
      --no-configure    do not use the package's configure script
      --no-docs		do not build and install documentation
      --with-package-versions
                        allow for multiple versions of the same package
      --use-zip-data	collect data files in zip archive
      --use-zip-help	collect help and examples into zip archives
      --use-zip		combine '--use-zip-data' and '--use-zip-help'
      --fake		do minimal install for testing purposes
      --no-lock		install on top of any existing installation
                        without using a lock directory
      --libs-only      	only install the libs directory
      --build           build binary tarball(s) of the installed package(s)

Report bugs to <r-bugs@r-project.org>."

## <NOTE>
## This is a *shell* script.
## According to the R Coding Standards (see R-exts), Perl can be assumed
## for *source*, but not for *binary* installations.
## </NOTE>

## <NOTE>
## We try to be defensive about possible white space in file names,
## hence all the strange quoting ...
## </NOTE>

umask 022

R_VERSION='2.7.1'
GETWD='/bin/pwd'
R_GZIPCMD='/bin/gzip'

: ${R_ARCH=}
SED=/bin/sed

if mkdir -p . 2>/dev/null; then
  MKDIR_P="mkdir -p"
else
  MKDIR_P="${R_HOME}/bin/mkinstalldirs"
fi

warning () { echo "WARNING: $*" >&2 ; }
error ()   { echo "ERROR: $*" >&2 ; }

startdir=`${GETWD}`
: ${TMPDIR=/tmp}
{ tmpdir=`(mktemp -d -q "${TMPDIR}/R.INSTALL.XXXXXX") 2>/dev/null` \
    && test -n "${tmpdir}" && test -d "${tmpdir}" ; } ||
  { test -n "${RANDOM}" && tmpdir=${TMPDIR}/R.INSTALL$$-${RANDOM} \
      && (${MKDIR_P} "${tmpdir}") ; } ||
  { tmpdir=${TMPDIR}/R.INSTALL.$$-`date +%m%d%H%M%S` && (${MKDIR_P} "${tmpdir}") ; } ||
  { tmpdir=${TMPDIR}/R.INSTALL.$$ && (${MKDIR_P} "${tmpdir}") ; } ||
  (error "cannot create temporary directory" && exit 1)
tmpdir=`cd "${tmpdir}" && ${GETWD}`

: ${R_OSTYPE=unix}
## <NOTE>
## Unix only ... but Windows has INSTALL as a Perl script.
R_EXE="${R_HOME}/bin/R"
## </NOTE>

## record R_LIBS at this point
R_LIBS0=${R_LIBS}

## <NOTE>
## This could be made a bit more general: if R CMD INSTALL is run by
## another tool (e.g., when building or checking a package, its messages
## should be a section level deeper (at least).  So we could have an
## argument to set the initial secnumdepth (0 by default), and work
## against this ...
message () { echo "${stars} $*"; }
stars="*"
## </NOTE>

. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\/,g'`
    ## (Need to escape whatever we use as sed delimiter.)
    echo "$1" | ${SED} "s/^~/${h}/"
}

get_packages () {
  ## get the full path names to all packages contained in $1.
  ## NOTE: modifies pkgs!
  if grep "^Contains:" "${1}/DESCRIPTION" >/dev/null; then
    contains=`get_dcf_field Contains "${1}/DESCRIPTION"`
    ## Be careful whether package listed in the Contains field really
    ## "be as. "${R_SHARE_DIR}/sh/dcf.sh"	# get_dcf_field()

tilde_expand () {
    h=`echo "${HOME}" | ${SED} 's,/,\\\