Skip to content

Commit 977c2fe

Browse files
authored
allow spaces in ORACLE_HOME and other environment variables with a path (#900)
allow spaces in ORACLE_HOME
1 parent e4c9f5c commit 977c2fe

12 files changed

+53
-41
lines changed

installer/src/main/bin/compareModel.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ WLSDEPLOY_PROGRAM_NAME="compareModel"; export WLSDEPLOY_PROGRAM_NAME
4545

4646
scriptName=$(basename "$0")
4747
scriptPath=$(dirname "$0")
48-
scriptArgs=$*
4948

5049
. "$scriptPath/shared.sh"
5150

@@ -56,4 +55,4 @@ checkJythonArgs "$@"
5655
# Java 7 is required, no encryption is used
5756
javaSetup 7
5857

59-
runJython compare_model.py
58+
runJython compare_model.py "$@"

installer/src/main/bin/createDomain.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ WLSDEPLOY_PROGRAM_NAME="createDomain"; export WLSDEPLOY_PROGRAM_NAME
109109

110110
scriptName=$(basename "$0")
111111
scriptPath=$(dirname "$0")
112-
scriptArgs=$*
113112

114113
. "$scriptPath/shared.sh"
115114

@@ -125,4 +124,4 @@ fi
125124
# required Java version is dependent on use of encryption
126125
javaSetup $minJdkVersion
127126

128-
runWlst create.py
127+
runWlst create.py "$@"

installer/src/main/bin/deployApps.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ WLSDEPLOY_PROGRAM_NAME="deployApps"; export WLSDEPLOY_PROGRAM_NAME
9494

9595
scriptName=$(basename "$0")
9696
scriptPath=$(dirname "$0")
97-
scriptArgs=$*
9897

9998
. "$scriptPath/shared.sh"
10099

@@ -110,4 +109,4 @@ fi
110109
# required Java version is dependent on use of encryption
111110
javaSetup $minJdkVersion
112111

113-
runWlst deploy.py
112+
runWlst deploy.py "$@"

installer/src/main/bin/discoverDomain.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ WLSDEPLOY_PROGRAM_NAME="discoverDomain"; export WLSDEPLOY_PROGRAM_NAME
9292

9393
scriptName=$(basename "$0")
9494
scriptPath=$(dirname "$0")
95-
scriptArgs=$*
9695

9796
. "$scriptPath/shared.sh"
9897

@@ -108,4 +107,4 @@ fi
108107
# required Java version is dependent on use of encryption
109108
javaSetup $minJdkVersion
110109

111-
runWlst discover.py
110+
runWlst discover.py "$@"

installer/src/main/bin/encryptModel.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ WLSDEPLOY_PROGRAM_NAME="encryptModel"; export WLSDEPLOY_PROGRAM_NAME
6565

6666
scriptName=$(basename "$0")
6767
scriptPath=$(dirname "$0")
68-
scriptArgs=$*
6968

7069
. "$scriptPath/shared.sh"
7170

@@ -76,4 +75,4 @@ checkJythonArgs "$@"
7675
# Java 8 is required for encryption library
7776
javaSetup 8
7877

79-
runJython encrypt.py
78+
runJython encrypt.py "$@"

installer/src/main/bin/extractDomainResource.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ WLSDEPLOY_PROGRAM_NAME="extractDomainResource"; export WLSDEPLOY_PROGRAM_NAME
7171

7272
scriptName=$(basename "$0")
7373
scriptPath=$(dirname "$0")
74-
scriptArgs=$*
7574

7675
. "$scriptPath/shared.sh"
7776

@@ -87,4 +86,4 @@ fi
8786
# required Java version is dependent on use of encryption
8887
javaSetup $minJdkVersion
8988

90-
runJython extract_resource.py
89+
runJython extract_resource.py "$@"

installer/src/main/bin/injectVariables.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ WLSDEPLOY_PROGRAM_NAME="injectVariables"; export WLSDEPLOY_PROGRAM_NAME
7474

7575
scriptName=$(basename "$0")
7676
scriptPath=$(dirname "$0")
77-
scriptArgs=$*
7877

7978
. "$scriptPath/shared.sh"
8079

@@ -85,4 +84,4 @@ checkJythonArgs "$@"
8584
# Java 7 is required, no encryption is used
8685
javaSetup 7
8786

88-
runJython variable_inject.py
87+
runJython variable_inject.py "$@"

installer/src/main/bin/modelHelp.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ WLSDEPLOY_PROGRAM_NAME="modelHelp"; export WLSDEPLOY_PROGRAM_NAME
7171

7272
scriptName=$(basename "$0")
7373
scriptPath=$(dirname "$0")
74-
scriptArgs=$*
7574

7675
. "$scriptPath/shared.sh"
7776

@@ -82,4 +81,4 @@ checkJythonArgs "$@"
8281
# Java 7 is required, no encryption is used
8382
javaSetup 7
8483

85-
runJython model_help.py
84+
runJython model_help.py "$@"

installer/src/main/bin/prepareModel.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ WLSDEPLOY_PROGRAM_NAME="prepareModel"; export WLSDEPLOY_PROGRAM_NAME
4343

4444
scriptName=$(basename "$0")
4545
scriptPath=$(dirname "$0")
46-
scriptArgs=$*
4746

4847
. "$scriptPath/shared.sh"
4948

@@ -54,4 +53,4 @@ checkJythonArgs "$@"
5453
# Java 7 is required, no encryption is used
5554
javaSetup 7
5655

57-
runJython prepare_model.py
56+
runJython prepare_model.py "$@"

installer/src/main/bin/shared.sh

Lines changed: 42 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ checkJythonArgs() {
126126
# if -oracle_home argument was not found, but ORACLE_HOME was set in environment,
127127
# add the -oracle_home argument with the environment value.
128128
# put it at the beginning to protect trailing arguments.
129-
scriptArgs="-oracle_home \"${ORACLE_HOME}\" ${scriptArgs}"
129+
OHARG="-oracle_home "
130+
OHARG_VALUE="${ORACLE_HOME}"
130131
fi
131132

132133
#
@@ -236,9 +237,13 @@ runWlst() {
236237
echo "WLST_PROPERTIES = ${WLST_PROPERTIES}"
237238

238239
PY_SCRIPTS_PATH="${WLSDEPLOY_HOME}/lib/python"
239-
echo "${WLST} ${PY_SCRIPTS_PATH}/$wlstScript ${scriptArgs}"
240-
241-
"${WLST}" "${PY_SCRIPTS_PATH}/$wlstScript" ${scriptArgs}
240+
if [ -z "${OHARG_VALUE}" ] ; then
241+
echo "${WLST} ${PY_SCRIPTS_PATH}/$wlstScript ${@:2}"
242+
"${WLST}" "${PY_SCRIPTS_PATH}/$wlstScript" "${@:2}"
243+
else
244+
echo "${WLST} ${PY_SCRIPTS_PATH}/$wlstScript $OHARG \"${OHARG_VALUE}\" ${@:2}"
245+
"${WLST}" "${PY_SCRIPTS_PATH}/$wlstScript" $OHARG "${OHARG_VALUE}" "${@:2}"
246+
fi
242247

243248
RETURN_CODE=$?
244249
checkExitCode ${RETURN_CODE}
@@ -263,14 +268,13 @@ runJython() {
263268
variableSetup
264269

265270
JAVA_PROPERTIES="-Djava.util.logging.config.class=${LOG_CONFIG_CLASS}"
266-
JAVA_PROPERTIES="${JAVA_PROPERTIES} -Dpython.cachedir.skip=true"
267-
JAVA_PROPERTIES="${JAVA_PROPERTIES} -Dpython.path=${ORACLE_SERVER_DIR}/common/wlst/modules/jython-modules.jar/Lib"
268-
JAVA_PROPERTIES="${JAVA_PROPERTIES} -Dpython.console="
269-
JAVA_PROPERTIES="${JAVA_PROPERTIES} ${WLSDEPLOY_PROPERTIES}"
271+
JAVA_PROPERTIES+=" -Dpython.cachedir.skip=true"
272+
JAVA_PROPERTIES+=" -Dpython.console="
273+
JAVA_PROPERTIES+=" ${WLSDEPLOY_PROPERTIES}"
270274
export JAVA_PROPERTIES
271-
272275
CLASSPATH="${WLSDEPLOY_HOME}/lib/weblogic-deploy-core.jar"
273-
CLASSPATH="${CLASSPATH}:${ORACLE_SERVER_DIR}/server/lib/weblogic.jar"
276+
CLASSPATH+=":"
277+
CLASSPATH+="$ORACLE_SERVER_DIR/server/lib/weblogic.jar"
274278

275279
# print the configuration, and run the script
276280

@@ -280,16 +284,35 @@ runJython() {
280284

281285
PY_SCRIPTS_PATH="${WLSDEPLOY_HOME}/lib/python"
282286

283-
echo \
284-
${JAVA_HOME}/bin/java -cp ${CLASSPATH} \
285-
${JAVA_PROPERTIES} \
286-
org.python.util.jython \
287-
"${PY_SCRIPTS_PATH}/$jythonScript" ${scriptArgs}
288287

289-
"${JAVA_HOME}/bin/java" -cp "${CLASSPATH}" \
290-
${JAVA_PROPERTIES} \
291-
org.python.util.jython \
292-
"${PY_SCRIPTS_PATH}/$jythonScript" ${scriptArgs}
288+
289+
if [ -z "${OHARG_VALUE}" ] ; then
290+
echo \
291+
${JAVA_HOME}/bin/java -cp ${CLASSPATH} \
292+
$JAVA_PROPERTIES \
293+
-Dpython.path="$ORACLE_SERVER_DIR/common/wlst/modules/jython-modules.jar/Lib" \
294+
org.python.util.jython \
295+
"${PY_SCRIPTS_PATH}/$jythonScript" ${@:2}
296+
297+
"${JAVA_HOME}/bin/java" -cp "$CLASSPATH" \
298+
$JAVA_PROPERTIES \
299+
-Dpython.path="$ORACLE_SERVER_DIR/common/wlst/modules/jython-modules.jar/Lib" \
300+
org.python.util.jython \
301+
"${PY_SCRIPTS_PATH}/$jythonScript" "${@:2}"
302+
else
303+
echo \
304+
${JAVA_HOME}/bin/java -cp ${CLASSPATH} \
305+
$JAVA_PROPERTIES \
306+
-Dpython.path="$ORACLE_SERVER_DIR/common/wlst/modules/jython-modules.jar/Lib" \
307+
org.python.util.jython \
308+
"${PY_SCRIPTS_PATH}/$jythonScript" $OHARG \"${OHARG_VALUE}\" ${@:2}
309+
310+
"${JAVA_HOME}/bin/java" -cp "$CLASSPATH" \
311+
$JAVA_PROPERTIES \
312+
-Dpython.path="$ORACLE_SERVER_DIR/common/wlst/modules/jython-modules.jar/Lib" \
313+
org.python.util.jython \
314+
"${PY_SCRIPTS_PATH}/$jythonScript" $OHARG "${OHARG_VALUE}" "${@:2}"
315+
fi
293316

294317
RETURN_CODE=$?
295318
checkExitCode ${RETURN_CODE}

0 commit comments

Comments
 (0)