From bd12477a831849f3cdc4e7cce45e6c275449562a Mon Sep 17 00:00:00 2001 From: Pablo Carle Date: Tue, 26 Nov 2024 21:07:37 +0100 Subject: [PATCH] chore: remove logs from configure.sh (#3913) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * remove log line Signed-off-by: Pablo Hernán Carle * add java to PATH in configure.sh Signed-off-by: MarkAckert * fix potential encoding issues for static definition Signed-off-by: MarkAckert --------- Signed-off-by: Pablo Hernán Carle Signed-off-by: MarkAckert Co-authored-by: Pablo Hernán Carle Co-authored-by: MarkAckert --- .../src/main/resources/bin/configure.sh | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/discovery-package/src/main/resources/bin/configure.sh b/discovery-package/src/main/resources/bin/configure.sh index 6584b6a7b3..4afe056637 100644 --- a/discovery-package/src/main/resources/bin/configure.sh +++ b/discovery-package/src/main/resources/bin/configure.sh @@ -15,8 +15,6 @@ if [ -z "$ZWE_zowe_workspaceDirectory" ]; then exit 1 fi -echo "$(env)" > $ZWE_zowe_workspaceDirectory/api-mediation/api-defs/env - INSTANCE_ID=$ZWE_haInstance_id if [ -z "$INSTANCE_ID" ]; then @@ -33,12 +31,20 @@ if [ "$ZWE_zowe_network_client_tls_attls" = "true" ]; then ZOSMF_SCHEME=http fi +if [ -n "$JAVA_HOME" ]; then + PATH=$JAVA_HOME/bin:$PATH +elif [ -n "$ZWE_java_home" ]; then + PATH=$ZWE_java_home/bin:$PATH +else + echo "[discovery-configure.sh]: java_home not found, discovery service relying on PATH to find java" +fi + if [ -e "$SOURCE_FILE" ]; then - chtag -tc ISO8859-1 $SOURCE_FILE - sed -e "s|%ZOSMF_SCHEME%|${ZOSMF_SCHEME}|g" $SOURCE_FILE > $DEST_FILE - iconv -f IBM-1047 -t ISO8859-1 $DEST_FILE > $SOURCE_FILE - chtag -tc ISO8859-1 $SOURCE_FILE + # _BPXK_AUTOCVT is set on some systems and resulted in twice-converted files when run through chtag and sed + _BPXK_AUTOCVT="OFF" sed -W filecodeset=ISO8859-1 -e "s|%ZOSMF_SCHEME%|${ZOSMF_SCHEME}|g" $SOURCE_FILE >$DEST_FILE # implicit EBCDIC out + iconv -f IBM-1047 -t ISO8859-1 $DEST_FILE >$SOURCE_FILE + _BPXK_AUTOCVT="OFF" chtag -tc ISO8859-1 $SOURCE_FILE rm -f $DEST_FILE else - echo "File $SOURCE_FILE not found" + echo "[discovery-configure.sh]: File $SOURCE_FILE not found" fi