From 2e660cac9a0e0c01b48f154d395852345e1355da Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 1 Aug 2024 15:40:56 +0100 Subject: [PATCH] JAL-3631 Convert both CLASSPATHS in update.sh --- utils/getdown/bin/jalview.ps1 | 2 +- utils/getdown/bin/update.sh | 62 ++++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 29 deletions(-) diff --git a/utils/getdown/bin/jalview.ps1 b/utils/getdown/bin/jalview.ps1 index edf0e49..382b22e 100755 --- a/utils/getdown/bin/jalview.ps1 +++ b/utils/getdown/bin/jalview.ps1 @@ -66,7 +66,7 @@ function Readlink-f { If ( $( Split-Path -Path $target -IsAbsolute ) ) { $file = Get-Item -Path $target } Else { -# symbolic link is relative: combine previous link parent dir with the link target and resolve + # symbolic link is relative: combine previous link parent dir with the link target and resolve $file = Get-Item -Path ( Join-Path -Path ( Split-Path -Path $prevfile -Parent ) -ChildPath $target -Resolve ) } } diff --git a/utils/getdown/bin/update.sh b/utils/getdown/bin/update.sh index 92c28c2..9b9d2ac 100755 --- a/utils/getdown/bin/update.sh +++ b/utils/getdown/bin/update.sh @@ -2,6 +2,32 @@ declare -a ARGS=("${@}") +ISMACOS=0 +if [ "$( uname -s )" = "Darwin" ]; then + ISMACOS=1 +fi + +DEBUG=0 +USERSPACE=0 +INSTALLATION=0 +for RAWARG in "${@}"; do + ARG="${RAWARG%%=*}" + case "${ARG}" in + --debug) + DEBUG=1 + ;; + --installation) + INSTALLATION=1 + ;; + --userspace) + USERSPACE=1 + ;; + *) + echo "Unknown option '${ARG}'. Please use either --installation or --userspace." >&2 + exit 2 + esac +done + # this whole next part is because there's no readlink -f in Darwin function readlinkf() { FINDFILE="$1" @@ -30,32 +56,6 @@ function readlinkf() { echo "${FILE}" } -ISMACOS=0 -if [ "$( uname -s )" = "Darwin" ]; then - ISMACOS=1 -fi - -DEBUG=0 -USERSPACE=0 -INSTALLATION=0 -for RAWARG in "${@}"; do - ARG="${RAWARG%%=*}" - case "${ARG}" in - --debug) - DEBUG=1 - ;; - --installation) - INSTALLATION=1 - ;; - --userspace) - USERSPACE=1 - ;; - *) - echo "Unkown option '${ARG}'" >&2 - exit 2 - esac -done - # args for the JVM declare -a JVMARGS=() @@ -183,15 +183,21 @@ GDL_ARGS=( "${GDL_ARGS[@]}" "--headless" "--quit" "--nojavaconsole" "--nosplash" # change paths for Cygwin or WSL if [ "${ISMACOS}" != 1 ]; then # older macos doesn't like uname -o, best to avoid if [ "$(uname -o)" = "Cygwin" ]; then - # CYGWIN + # CYGWIN GDL_CLASSPATH=$(cygpath -pw "${GDL_CLASSPATH}") + GDC_CLASSPATH=$(cygpath -pw "${GDC_CLASSPATH}") elif uname -r | grep -i microsoft | grep -i wsl >/dev/null; then - # WSL + # WSL GDL_CLASSPATH="" for JARPATH in "${GDL_JARPATHS[@]}"; do [ -n "${GDL_CLASSPATH}" ] && GDL_CLASSPATH="${GDL_CLASSPATH};" GDL_CLASSPATH="${GDL_CLASSPATH}$(wslpath -aw "${JARPATH}")" done + GDC_CLASSPATH="" + for JARPATH in "${GDC_JARPATHS[@]}"; do + [ -n "${GDC_CLASSPATH}" ] && GDC_CLASSPATH="${GDC_CLASSPATH};" + GDC_CLASSPATH="${GDC_CLASSPATH}$(wslpath -aw "${JARPATH}")" + done JAVA="${JAVA}.exe" SYSJAVA="java.exe" fi -- 1.7.10.2