YETUS-96. multijdkdirs shouldn't show errors on bad input Signed-off-by: Allen Wittenauer <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/21789a2a Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/21789a2a Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/21789a2a Branch: refs/heads/master Commit: 21789a2ad9d0fce6ccb5fd1d3c09607700f3a981 Parents: 34cfb45 Author: Allen Wittenauer <[email protected]> Authored: Mon Oct 19 11:51:13 2015 -0700 Committer: Allen Wittenauer <[email protected]> Committed: Tue Oct 20 07:40:34 2015 -0700 ---------------------------------------------------------------------- dev-support/test-patch.d/java.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/21789a2a/dev-support/test-patch.d/java.sh ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.d/java.sh b/dev-support/test-patch.d/java.sh index 01dfab4..e1a73c7 100755 --- a/dev-support/test-patch.d/java.sh +++ b/dev-support/test-patch.d/java.sh @@ -23,6 +23,12 @@ function javac_initialize local jdkdir local tmplist + # if we are in pre-docker mode, don't do any of + # this work since it's all going to be wrong anyway + if [[ "${DOCKERSUPPORT}" = "true" ]]; then + return 0 + fi + if [[ -z ${JAVA_HOME:-} ]]; then case ${OSTYPE} in Darwin) @@ -47,9 +53,13 @@ function javac_initialize JAVA_HOME=$(cd -P -- "${JAVA_HOME}" >/dev/null && pwd -P) for i in ${JDK_DIR_LIST}; do - jdkdir=$(cd -P -- "${i}" >/dev/null && pwd -P) - if [[ ${jdkdir} != "${JAVA_HOME}" ]]; then - tmplist="${tmplist} ${jdkdir}" + if [[ -d "${i}" ]]; then + jdkdir=$(cd -P -- "${i}" >/dev/null && pwd -P) + if [[ ${jdkdir} != "${JAVA_HOME}" ]]; then + tmplist="${tmplist} ${jdkdir}" + fi + else + yetus_error "WARNING: Cannot locate JDK directory ${i}: ignoring" fi done
