Changeset 15916 in josm for trunk/linux/latest/usr/bin
- Timestamp:
- 2020-02-23T22:05:36+01:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/linux/latest/usr/bin/josm-latest
r15914 r15916 1 #!/bin/ sh1 #!/bin/bash 2 2 # Simple wrapper script used to start JOSM in Debian 3 3 set -e … … 5 5 # First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK. 6 6 # Override to a specific one using $JAVACMD 7 ALTERNATIVE_JDK= "`readlink -n -f /etc/alternatives/java`"7 ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java) 8 8 9 9 # Let's get the current architecture -- needed for multiarchified Java 10 ARCH= "`dpkg --print-architecture 2> /dev/null || true`"10 ARCH=$(dpkg --print-architecture 2> /dev/null || true) 11 11 12 12 JAVA_CMDS="$JAVA_HOME/bin/java" 13 13 14 14 # If OpenJDK is only available headless, do not try it 15 if dpkg --get-selections 'openjdk-*-jre'| grep install$ > /dev/null \16 || dpkg --get-selections 'openjdk-*-jre:$ARCH'| grep install$ > /dev/null ; then15 if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \ 16 || dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then 17 17 # LTS versions in decreased order 18 18 JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java" … … 38 38 if [ -z "${JAVACMD}" ]; then 39 39 for jcmd in $JAVA_CMDS; do 40 if [ "z$ALTERNATIVE_JDK" = "z `readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then40 if [ "z$ALTERNATIVE_JDK" = "z$(readlink -n -f "$jcmd")" ] && [ -z "${JAVACMD}" ]; then 41 41 JAVACMD="$jcmd" 42 42 break … … 47 47 if [ -z "${JAVACMD}" ]; then 48 48 for jcmd in $JAVA_CMDS; do 49 if [ -x "$jcmd" -a-z "${JAVACMD}" ]; then49 if [ -x "$jcmd" ] && [ -z "${JAVACMD}" ]; then 50 50 JAVACMD="$jcmd" 51 51 break … … 56 56 if [ "$JAVACMD" ]; then 57 57 echo "Using $JAVACMD to execute josm-latest." || true 58 if [ "`expr match \"${JAVACMD}\" 'java-9'`" != "0" ] || [ "`expr match \"${JAVACMD}\" 'java-10'`" != "0"]; then58 if [[ "${JAVACMD}" =~ 'java-9' ]] || [[ "${JAVACMD}" =~ 'java-10' ]]; then 59 59 JAVA_OPTS="--add-modules java.activation,java.se.ee $JAVA_OPTS" 60 elif [ "`expr match \"${JAVACMD}\" 'java-1'`" != "0"]; then60 elif [[ "${JAVACMD}" =~ 'java-1' ]]; then 61 61 JAVA_OPTS="--add-modules java.scripting,java.sql $JAVA_OPTS" 62 62 fi 63 63 set +e 64 64 while true; do 65 $JAVACMD $JAVA_OPTS-jar /usr/share/josm-latest/josm-latest.jar "$@"65 $JAVACMD "$JAVA_OPTS" -jar /usr/share/josm-latest/josm-latest.jar "$@" 66 66 if [ "z$?" != "z9" ]; then 67 67 break
Note:
See TracChangeset
for help on using the changeset viewer.