diff options
author | Felix Cheung <felixcheung_m@hotmail.com> | 2017-01-16 13:49:12 -0800 |
---|---|---|
committer | Felix Cheung <felixcheung@apache.org> | 2017-01-16 13:49:12 -0800 |
commit | c84f7d3e1b845bc1e595ce9a6e2de663c2d218f4 (patch) | |
tree | f5988031c266dfadaa4a791b07b0737cb39ab529 /R/check-cran.sh | |
parent | a115a54399cd4bedb1a5086943a88af6339fbe85 (diff) | |
download | spark-c84f7d3e1b845bc1e595ce9a6e2de663c2d218f4.tar.gz spark-c84f7d3e1b845bc1e595ce9a6e2de663c2d218f4.tar.bz2 spark-c84f7d3e1b845bc1e595ce9a6e2de663c2d218f4.zip |
[SPARK-18828][SPARKR] Refactor scripts for R
## What changes were proposed in this pull request?
Refactored script to remove duplications and clearer purpose for each script
## How was this patch tested?
manually
Author: Felix Cheung <felixcheung_m@hotmail.com>
Closes #16249 from felixcheung/rscripts.
Diffstat (limited to 'R/check-cran.sh')
-rwxr-xr-x | R/check-cran.sh | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/R/check-cran.sh b/R/check-cran.sh index 1288e7fc9f..a188b1448a 100755 --- a/R/check-cran.sh +++ b/R/check-cran.sh @@ -20,25 +20,14 @@ set -o pipefail set -e -FWDIR="$(cd `dirname $0`; pwd)" +FWDIR="$(cd `dirname "${BASH_SOURCE[0]}"`; pwd)" pushd $FWDIR > /dev/null -if [ ! -z "$R_HOME" ] - then - R_SCRIPT_PATH="$R_HOME/bin" - else - # if system wide R_HOME is not found, then exit - if [ ! `command -v R` ]; then - echo "Cannot find 'R_HOME'. Please specify 'R_HOME' or make sure R is properly installed." - exit 1 - fi - R_SCRIPT_PATH="$(dirname $(which R))" -fi -echo "Using R_SCRIPT_PATH = ${R_SCRIPT_PATH}" +. $FWDIR/find-r.sh # Install the package (this is required for code in vignettes to run when building it later) # Build the latest docs, but not vignettes, which is built with the package next -$FWDIR/create-docs.sh +. $FWDIR/install-dev.sh # Build source package with vignettes SPARK_HOME="$(cd "${FWDIR}"/..; pwd)" @@ -84,19 +73,4 @@ else SPARK_HOME="${SPARK_HOME}" "$R_SCRIPT_PATH/"R CMD check $CRAN_CHECK_OPTIONS SparkR_"$VERSION".tar.gz fi -# Install source package to get it to generate vignettes rds files, etc. -if [ -n "$CLEAN_INSTALL" ] -then - echo "Removing lib path and installing from source package" - LIB_DIR="$FWDIR/lib" - rm -rf $LIB_DIR - mkdir -p $LIB_DIR - "$R_SCRIPT_PATH/"R CMD INSTALL SparkR_"$VERSION".tar.gz --library=$LIB_DIR - - # Zip the SparkR package so that it can be distributed to worker nodes on YARN - pushd $LIB_DIR > /dev/null - jar cfM "$LIB_DIR/sparkr.zip" SparkR - popd > /dev/null -fi - popd > /dev/null |