From 1d9708a954e2d764f6ba933c4e9ba117afa9b4c4 Mon Sep 17 00:00:00 2001 From: Joseph Walton Date: Mon, 30 Jan 2017 11:01:49 +0100 Subject: [PATCH] [MNG-5829] mvn shell script fails with syntax error on Solaris 10 Use backticks instead of $(..) for the scripting added in MNG-5767. Solaris's /bin/sh isn't POSIX-compliant enough to recognise the first form. This closes #50. --- apache-maven/src/bin/mvn | 12 ++++++------ apache-maven/src/bin/mvnDebug | 2 +- apache-maven/src/bin/mvnyjp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn index 3a4dc26e95..4a7f610b79 100755 --- a/apache-maven/src/bin/mvn +++ b/apache-maven/src/bin/mvn @@ -192,14 +192,14 @@ fi find_maven_basedir() { local basedir local wdir - basedir="$(pwd)" - wdir="$(pwd)" + basedir="`pwd`" + wdir="`pwd`" while [ "$wdir" != '/' ] ; do if [ -d "$wdir"/.mvn ] ; then basedir=$wdir break fi - wdir="$(cd "$wdir/.."; pwd)" + wdir="`cd "$wdir/.."; pwd`" done echo "${basedir}" } @@ -207,12 +207,12 @@ find_maven_basedir() { # concatenates all lines of a file concat_lines() { if [ -f "$1" ]; then - echo "$(tr -s '\n' ' ' < "$1")" + echo "`tr -s '\n' ' ' < "$1"`" fi } -MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-$(find_maven_basedir)}" -MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" +MAVEN_PROJECTBASEDIR="${MAVEN_BASEDIR:-`find_maven_basedir`}" +MAVEN_OPTS="`concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config"` $MAVEN_OPTS" # For Cygwin, switch project base directory path to Windows format before # executing Maven otherwise this will cause Maven not to consider it. diff --git a/apache-maven/src/bin/mvnDebug b/apache-maven/src/bin/mvnDebug index 8d6e6a1a8d..be495ff15d 100755 --- a/apache-maven/src/bin/mvnDebug +++ b/apache-maven/src/bin/mvnDebug @@ -31,4 +31,4 @@ MAVEN_DEBUG_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,addre echo Preparing to execute Maven in debug mode -env MAVEN_OPTS="$MAVEN_OPTS" MAVEN_DEBUG_OPTS="$MAVEN_DEBUG_OPTS" "$(dirname "$0")/mvn" "$@" +env MAVEN_OPTS="$MAVEN_OPTS" MAVEN_DEBUG_OPTS="$MAVEN_DEBUG_OPTS" "`dirname "$0"`/mvn" "$@" diff --git a/apache-maven/src/bin/mvnyjp b/apache-maven/src/bin/mvnyjp index b2dbe1de9e..a35eabf1f6 100755 --- a/apache-maven/src/bin/mvnyjp +++ b/apache-maven/src/bin/mvnyjp @@ -32,4 +32,4 @@ if [ ! -f "$YJPLIB" ]; then exit 1 fi -env MAVEN_OPTS="-agentpath:$YJPLIB=onexit=snapshot,onexit=memory,tracing,onlylocal $MAVEN_OPTS" "$(dirname "$0")/mvn" "$@" +env MAVEN_OPTS="-agentpath:$YJPLIB=onexit=snapshot,onexit=memory,tracing,onlylocal $MAVEN_OPTS" "`dirname "$0"`/mvn" "$@"