From 9ba2c5b1e8e92123d87cf8954eb0e1986f8f075b Mon Sep 17 00:00:00 2001 From: Mick Jordan <mick.jordan@oracle.com> Date: Wed, 20 May 2015 21:41:45 -0700 Subject: [PATCH] test install pakages OS indepdence fixes --- com.oracle.truffle.r.native/run/R.sh | 13 ++++++++----- com.oracle.truffle.r.native/run/Rscript_exec.sh | 13 ++++++++----- .../truffle/r/test/rpackages/TestRPackages.java | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/com.oracle.truffle.r.native/run/R.sh b/com.oracle.truffle.r.native/run/R.sh index eaba495fc3..c59f02c557 100644 --- a/com.oracle.truffle.r.native/run/R.sh +++ b/com.oracle.truffle.r.native/run/R.sh @@ -33,14 +33,17 @@ source="${BASH_SOURCE[0]}" while [ -h "$source" ] ; do source="$(readlink "$source")"; done PRIMARY_PATH="$( cd -P "$( dirname "$source" )" && pwd )"/../.. -mx=`which mx` -if [ -z "$mx"] ; then +which mx >/dev/null 2>&1 +whichrc=$? +if [ $whichrc == 1 ] ; then if [ -z "$MX_HOME" ] ; then - echo "Error: mx cannot be found: add to PATH or set MX_HOME" - exit 1 + echo "Error: mx cannot be found: add to PATH or set MX_HOME" + exit 1 else - mx=$MX_HOME/mx + mx=$MX_HOME/mx fi +else + mx=`which mx` fi exec $mx $MX_R_GLOBAL_ARGS R $MX_R_CMD_ARGS "$@" diff --git a/com.oracle.truffle.r.native/run/Rscript_exec.sh b/com.oracle.truffle.r.native/run/Rscript_exec.sh index 8608362c6d..fab2fc1f0e 100644 --- a/com.oracle.truffle.r.native/run/Rscript_exec.sh +++ b/com.oracle.truffle.r.native/run/Rscript_exec.sh @@ -29,14 +29,17 @@ source="${BASH_SOURCE[0]}" while [ -h "$source" ] ; do source="$(readlink "$source")"; done PRIMARY_PATH="$( cd -P "$( dirname "$source" )" && pwd )"/../.. -mx=`which mx` -if [ -z "$mx"] ; then +which mx >/dev/null 2>&1 +whichrc=$? +if [ $whichrc == 1 ] ; then if [ -z "$MX_HOME" ] ; then - echo "Error: mx cannot be found: add to PATH or set MX_HOME" - exit 1 + echo "Error: mx cannot be found: add to PATH or set MX_HOME" + exit 1 else - mx=$MX_HOME/mx + mx=$MX_HOME/mx fi +else + mx=`which mx` fi exec $mx $MX_R_GLOBAL_ARGS Rscript $MX_R_CMD_ARGS "$@" diff --git a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/rpackages/TestRPackages.java b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/rpackages/TestRPackages.java index 3764dab248..67b6c651ae 100644 --- a/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/rpackages/TestRPackages.java +++ b/com.oracle.truffle.r.test/src/com/oracle/truffle/r/test/rpackages/TestRPackages.java @@ -85,7 +85,7 @@ public class TestRPackages extends TestBase { Map<String, String> env = pb.environment(); env.put("R_LIBS_USER", rpackagesLibs.toString()); if (!generatingExpected()) { - env.put("R_INSTALL_TAR", "/usr/bin/tar"); + env.put("R_INSTALL_TAR", REnvVars.get("TAR")); } try { if (FastROptions.debugMatches("TestRPackages")) { -- GitLab