aboutsummaryrefslogtreecommitdiff
path: root/make-distribution.sh
diff options
context:
space:
mode:
authorNick Lanham <nick@afternight.org>2014-03-27 22:45:00 -0700
committerMatei Zaharia <matei@databricks.com>2014-03-27 22:45:00 -0700
commit632c322036b123c6f72e0c8b87d50e08bec3a1ab (patch)
treeafb4950a5fd670b92c0ad024fe4c2d67b903fbb3 /make-distribution.sh
parent3d89043b7ed13bc1bb703f6eb7c00e46b936de1e (diff)
downloadspark-632c322036b123c6f72e0c8b87d50e08bec3a1ab.tar.gz
spark-632c322036b123c6f72e0c8b87d50e08bec3a1ab.tar.bz2
spark-632c322036b123c6f72e0c8b87d50e08bec3a1ab.zip
Make sed do -i '' on OSX
I don't have access to an OSX machine, so if someone could test this that would be great. Author: Nick Lanham <nick@afternight.org> Closes #258 from nicklan/osx-sed-fix and squashes the following commits: a6f158f [Nick Lanham] Also make mktemp work on OSX 558fd6e [Nick Lanham] Make sed do -i '' on OSX
Diffstat (limited to 'make-distribution.sh')
-rwxr-xr-xmake-distribution.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/make-distribution.sh b/make-distribution.sh
index 6bc6819d8d..b07aef2ef4 100755
--- a/make-distribution.sh
+++ b/make-distribution.sh
@@ -128,7 +128,7 @@ if [ "$SPARK_TACHYON" == "true" ]; then
TACHYON_VERSION="0.4.1"
TACHYON_URL="https://github.com/amplab/tachyon/releases/download/v${TACHYON_VERSION}/tachyon-${TACHYON_VERSION}-bin.tar.gz"
- TMPD=`mktemp -d`
+ TMPD=`mktemp -d 2>/dev/null || mktemp -d -t 'disttmp'`
pushd $TMPD > /dev/null
echo "Fetchting tachyon tgz"
@@ -139,7 +139,14 @@ if [ "$SPARK_TACHYON" == "true" ]; then
mkdir -p "$DISTDIR/tachyon/src/main/java/tachyon/web"
cp -r "tachyon-${TACHYON_VERSION}"/{bin,conf,libexec} "$DISTDIR/tachyon"
cp -r "tachyon-${TACHYON_VERSION}"/src/main/java/tachyon/web/resources "$DISTDIR/tachyon/src/main/java/tachyon/web"
- sed -i "s|export TACHYON_JAR=\$TACHYON_HOME/target/\(.*\)|# This is set for spark's make-distribution\n export TACHYON_JAR=\$TACHYON_HOME/../../jars/\1|" "$DISTDIR/tachyon/libexec/tachyon-config.sh"
+
+ if [[ `uname -a` == Darwin* ]]; then
+ # osx sed wants an empty argument to -i option of sed
+ TACHYON_SED="sed -i ''"
+ else
+ TACHYON_SED="sed -i"
+ fi
+ $TACHYON_SED -e "s|export TACHYON_JAR=\$TACHYON_HOME/target/\(.*\)|# This is set for spark's make-distribution\n export TACHYON_JAR=\$TACHYON_HOME/../../jars/\1|" "$DISTDIR/tachyon/libexec/tachyon-config.sh"
popd > /dev/null
rm -rf $TMPD