Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added defensive quoting to XDG_SESSION_TYPE #4252 #4730

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions assemblies/static/src/main/resources/hop-conf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,23 @@ HOP_OPTIONS="${HOP_OPTIONS} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --

case $(uname -s) in
Linux)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
# Workaround for https://github.com/apache/hop/issues/4252
# Related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/639
# And to some extent also https://github.com/eclipse-platform/eclipse.platform.swt/issues/790
if [ "${XDG_SESSION_TYPE}" == "wayland" ]; then
export GDK_BACKEND=x11
fi
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
;;
Darwin)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
fi
HOP_OPTIONS="${HOP_OPTIONS} -XstartOnFirstThread"
;;
Expand Down
20 changes: 13 additions & 7 deletions assemblies/static/src/main/resources/hop-encrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,23 @@ HOP_OPTIONS="${HOP_OPTIONS} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --

case $(uname -s) in
Linux)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
# Workaround for https://github.com/apache/hop/issues/4252
# Related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/639
# And to some extent also https://github.com/eclipse-platform/eclipse.platform.swt/issues/790
if [ "${XDG_SESSION_TYPE}" == "wayland" ]; then
export GDK_BACKEND=x11
fi
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
;;
Darwin)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
fi
HOP_OPTIONS="${HOP_OPTIONS} -XstartOnFirstThread"
;;
Expand Down
26 changes: 13 additions & 13 deletions assemblies/static/src/main/resources/hop-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,23 @@ HOP_OPTIONS="${HOP_OPTIONS} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --

case $(uname -s) in
Linux)
# Workaround for https://github.com/apache/hop/issues/4252
# Related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/639
# And to some extent also https://github.com/eclipse-platform/eclipse.platform.swt/issues/790
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
export GDK_BACKEND=x11
fi
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
# Workaround for https://github.com/apache/hop/issues/4252
# Related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/639
# And to some extent also https://github.com/eclipse-platform/eclipse.platform.swt/issues/790
if [ "${XDG_SESSION_TYPE}" == "wayland" ]; then
export GDK_BACKEND=x11
fi
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
;;
Darwin)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
fi
HOP_OPTIONS="${HOP_OPTIONS} -XstartOnFirstThread"
;;
Expand Down
20 changes: 13 additions & 7 deletions assemblies/static/src/main/resources/hop-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,23 @@ HOP_OPTIONS="${HOP_OPTIONS} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --

case $(uname -s) in
Linux)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
# Workaround for https://github.com/apache/hop/issues/4252
# Related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/639
# And to some extent also https://github.com/eclipse-platform/eclipse.platform.swt/issues/790
if [ "${XDG_SESSION_TYPE}" == "wayland" ]; then
export GDK_BACKEND=x11
fi
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
;;
Darwin)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
fi
HOP_OPTIONS="${HOP_OPTIONS} -XstartOnFirstThread"
;;
Expand Down
20 changes: 13 additions & 7 deletions assemblies/static/src/main/resources/hop-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,23 @@ HOP_OPTIONS="${HOP_OPTIONS} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --

case $(uname -s) in
Linux)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
# Workaround for https://github.com/apache/hop/issues/4252
# Related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/639
# And to some extent also https://github.com/eclipse-platform/eclipse.platform.swt/issues/790
if [ "${XDG_SESSION_TYPE}" == "wayland" ]; then
export GDK_BACKEND=x11
fi
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
;;
Darwin)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
fi
HOP_OPTIONS="${HOP_OPTIONS} -XstartOnFirstThread"
;;
Expand Down
20 changes: 13 additions & 7 deletions assemblies/static/src/main/resources/hop-search.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,23 @@ HOP_OPTIONS="${HOP_OPTIONS} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --

case $(uname -s) in
Linux)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
# Workaround for https://github.com/apache/hop/issues/4252
# Related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/639
# And to some extent also https://github.com/eclipse-platform/eclipse.platform.swt/issues/790
if [ "${XDG_SESSION_TYPE}" == "wayland" ]; then
export GDK_BACKEND=x11
fi
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
;;
Darwin)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
fi
HOP_OPTIONS="${HOP_OPTIONS} -XstartOnFirstThread"
;;
Expand Down
20 changes: 13 additions & 7 deletions assemblies/static/src/main/resources/hop-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,17 +69,23 @@ HOP_OPTIONS="${HOP_OPTIONS} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --

case $(uname -s) in
Linux)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
# Workaround for https://github.com/apache/hop/issues/4252
# Related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/639
# And to some extent also https://github.com/eclipse-platform/eclipse.platform.swt/issues/790
if [ "${XDG_SESSION_TYPE}" == "wayland" ]; then
export GDK_BACKEND=x11
fi
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/linux/$(uname -m)/*"
fi
;;
Darwin)
if "${_HOP_JAVA}" -XshowSettings:properties -version 2>&1 | grep -q "os.arch = aarch64"; then
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/arm64/*"
else
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
CLASSPATH="lib/core/*:lib/beam/*:lib/swt/osx/x86_64/*"
fi
HOP_OPTIONS="${HOP_OPTIONS} -XstartOnFirstThread"
;;
Expand Down
Loading