From 9c423e9c54e85ad84f3143c9d3f8463d16b4ce67 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 16 Jun 2010 21:25:30 +0000 Subject: [PATCH] 316970 - jetty.sh fails to find JETTY_HOME in standard directories Reworked JETTY_HOME lookup to be more clear and resilient. git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@2018 7e9141cc-0065-0410-87d8-b60c137991c4 --- VERSION.txt | 1 + .../src/main/resources/bin/jetty.sh | 23 +++++++++++++++---- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index 418228ff446..17aa1b0a40d 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -3,6 +3,7 @@ jetty-7.1.5-SNAPSHOT + 316449 Websocket disconnect fix + 316584 Exception on startup if temp path has spaces and extractWAR=false + 316597 Removed null check and fixed name in Resource#hrefEncodeURI + + 316970 jetty.sh fails to find JETTY_HOME in standard directories + 316973 jetty.sh claims java installation is invalid + 317019 Date HTTP header not sent for HTTP/1.0 requests + JETTY-1237 Save local/remote address to be available after close diff --git a/jetty-distribution/src/main/resources/bin/jetty.sh b/jetty-distribution/src/main/resources/bin/jetty.sh index 672d7b2b697..cc15d46ed2b 100755 --- a/jetty-distribution/src/main/resources/bin/jetty.sh +++ b/jetty-distribution/src/main/resources/bin/jetty.sh @@ -206,13 +206,28 @@ if [ -z "$JETTY_HOME" ] ; then do for N in "${JETTY_DIR_NAMES[@]}" do - JETTY_HOME=("$L/"$N) - if [ ! -d "$JETTY_HOME" ] || [ ! -f "$JETTY_HOME/$JETTY_INSTALL_TRACE_FILE" ] + POSSIBLE_JETTY_HOME=("$L/"$N) + if [ ! -d "$POSSIBLE_JETTY_HOME" ] then - JETTY_HOME= + # Not a directory. skip. + unset POSSIBLE_JETTY_HOME + elif [ ! -f "$POSSIBLE_JETTY_HOME/$JETTY_INSTALL_TRACE_FILE" ] + then + # Trace file not found. skip. + unset POSSIBLE_JETTY_HOME + else + # Good hit, Use it + JETTY_HOME=$POSSIBLE_JETTY_HOME + # Break out of JETTY_DIR_NAMES loop + break fi - [ "$JETTY_HOME" ] && break done + if [ -n "$POSSIBLE_JETTY_HOME" ] + then + # We have found our JETTY_HOME + # Break out of STANDARD_LOCATIONS loop + break + fi done fi