The R Project SVN R

Rev

Rev 4562 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4562 Rev 4577
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
 
2
 
3
# ${RHOME}/bin/check for checking installed add-on packages
3
# ${R_HOME}/bin/check for checking installed add-on packages
4
 
4
 
5
USAGE_MSG="Usage: R CMD check [options] [-l lib] pkg_1 ... pkg_n"
5
USAGE_MSG="Usage: R CMD check [options] [-l lib] pkg_1 ... pkg_n"
6
VERSION="0.2-0"
6
VERSION="0.2-1"
7
 
7
 
8
OPTS=
8
OPTS=
9
PKGS=
9
PKGS=
10
CLEAN=false
10
CLEAN=false
11
DEBUG=false
11
DEBUG=false
12
REBUILD=true
12
REBUILD=true
13
START_DIR=`pwd`
13
START_DIR=`pwd`
14
lib=${RHOME}/library
14
lib=${R_HOME}/library
15
 
15
 
16
while test -n "${1}"; do
16
while test -n "${1}"; do
17
  case ${1} in
17
  case ${1} in
18
    -h|--help|-\?)
18
    -h|--help|-\?)
19
      echo "${USAGE_MSG}"; exit 0 ;;
19
      echo "${USAGE_MSG}"; exit 0 ;;
Line 25... Line 25...
25
      DEBUG=true; OPTS="${OPTS} --debug" ;;
25
      DEBUG=true; OPTS="${OPTS} --debug" ;;
26
    --no-rebuild)
26
    --no-rebuild)
27
      REBUILD=false ;;
27
      REBUILD=false ;;
28
    -l)
28
    -l)
29
      lib=${2}; shift;
29
      lib=${2}; shift;
30
      RLIBS="${lib}:${RLIBS}";
30
      R_LIBS="${lib}:${R_LIBS:-${RLIBS}}";
31
      ;;
31
      ;;
32
    *)
32
    *)
33
      PKGS="${PKGS} ${1}" ;;
33
      PKGS="${PKGS} ${1}" ;;
34
  esac
34
  esac
35
  shift
35
  shift
Line 68... Line 68...
68
    echo "WARNING: package \`${pkg}' not installed ... skipping"
68
    echo "WARNING: package \`${pkg}' not installed ... skipping"
69
    break
69
    break
70
  fi
70
  fi
71
 
71
 
72
  if ${USE_MAN}; then
72
  if ${USE_MAN}; then
73
    ${RHOME}/bin/build-help ${OPTS} --example ../${pkg} ${lib}
73
    ${R_HOME}/bin/build-help ${OPTS} --example ../${pkg} ${lib}
74
    CHECK_DIR=check
74
    CHECK_DIR=check
75
  else
75
  else
76
    CHECK_DIR=check-${pkg}
76
    CHECK_DIR=check-${pkg}
77
  fi
77
  fi
78
 
78
 
79
  test -d ${CHECK_DIR} || mkdir ${CHECK_DIR}
79
  test -d ${CHECK_DIR} || mkdir ${CHECK_DIR}
80
  cd ${CHECK_DIR}
80
  cd ${CHECK_DIR}
81
    
81
    
82
  echo " Massaging examples into \`${pkg}-Ex.R' ..."
82
  echo " Massaging examples into \`${pkg}-Ex.R' ..."
83
  ${RHOME}/bin/massage-Examples ${pkg} ${lib}/${pkg}/R-ex/*.R \
83
  ${R_HOME}/bin/massage-Examples ${pkg} ${lib}/${pkg}/R-ex/*.R \
84
    > ${pkg}-Ex.R
84
    > ${pkg}-Ex.R
85
  echo " Running examples in package \`${pkg}' ..."
85
  echo " Running examples in package \`${pkg}' ..."
86
  RLIBS=${RLIBS} ${RHOME}/bin/R --vanilla < ${pkg}-Ex.R \
86
  R_LIBS=${R_LIBS} ${R_HOME}/bin/R --vanilla < ${pkg}-Ex.R \
87
    > ${pkg}-Ex.Rout
87
    > ${pkg}-Ex.Rout
88
  if test ${?} -eq 0; then
88
  if test ${?} -eq 0; then
89
    echo " OK"
89
    echo " OK"
90
  else
90
  else
91
    echo " ERROR" && exit 1
91
    echo " ERROR" && exit 1