Changeset 15916 in josm


Ignore:
Timestamp:
2020-02-23T22:05:36+01:00 (5 years ago)
Author:
simon04
Message:

fix #18756 - Fix shellcheck warnings of shellscripts

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/linux/latest/DEBIAN/postinst

    r7506 r15916  
    22set -e
    33# Automatically added by dh_installmenu
    4 if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
     4if [ "$1" = "configure" ] && [ -x "$(which update-menus 2>/dev/null)" ]; then
    55        update-menus
    66fi
  • trunk/linux/latest/DEBIAN/postrm

    r7506 r15916  
    22set -e
    33# Automatically added by dh_installmenu
    4 if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
     4if [ -x "$(which update-menus 2>/dev/null)" ]; then update-menus ; fi
    55# End automatically added section
  • trunk/linux/latest/usr/bin/josm-latest

    r15914 r15916  
    1 #!/bin/sh
     1#!/bin/bash
    22# Simple wrapper script used to start JOSM in Debian
    33set -e
     
    55# First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK.
    66# Override to a specific one using $JAVACMD
    7 ALTERNATIVE_JDK="`readlink -n -f /etc/alternatives/java`"
     7ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java)
    88
    99# Let's get the current architecture -- needed for multiarchified Java
    10 ARCH="`dpkg --print-architecture 2> /dev/null || true`"
     10ARCH=$(dpkg --print-architecture 2> /dev/null || true)
    1111
    1212JAVA_CMDS="$JAVA_HOME/bin/java"
    1313
    1414# 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 ; then
     15if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \
     16|| dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then
    1717        # LTS versions in decreased order
    1818        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java"
     
    3838if [ -z "${JAVACMD}" ]; then
    3939    for jcmd in $JAVA_CMDS; do
    40         if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then
     40        if [ "z$ALTERNATIVE_JDK" = "z$(readlink -n -f "$jcmd")" ] && [ -z "${JAVACMD}" ]; then
    4141            JAVACMD="$jcmd"
    4242            break
     
    4747if [ -z "${JAVACMD}" ]; then
    4848    for jcmd in $JAVA_CMDS; do
    49         if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
     49        if [ -x "$jcmd" ] && [ -z "${JAVACMD}" ]; then
    5050            JAVACMD="$jcmd"
    5151            break
     
    5656if [ "$JAVACMD" ]; then
    5757    echo "Using $JAVACMD to execute josm-latest." || true
    58     if [ "`expr match \"${JAVACMD}\" 'java-9'`" != "0" ] || [ "`expr match \"${JAVACMD}\" 'java-10'`" != "0" ]; then
     58    if [[ "${JAVACMD}" =~ 'java-9' ]] || [[ "${JAVACMD}" =~ 'java-10' ]]; then
    5959        JAVA_OPTS="--add-modules java.activation,java.se.ee $JAVA_OPTS"
    60     elif [ "`expr match \"${JAVACMD}\" 'java-1'`" != "0" ]; then
     60    elif [[ "${JAVACMD}" =~ 'java-1' ]]; then
    6161        JAVA_OPTS="--add-modules java.scripting,java.sql $JAVA_OPTS"
    6262    fi
    6363    set +e
    6464    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 "$@"
    6666        if [ "z$?" != "z9" ]; then
    6767            break
  • trunk/linux/tested/DEBIAN/postinst

    r7506 r15916  
    22set -e
    33# Automatically added by dh_installmenu
    4 if [ "$1" = "configure" ] && [ -x "`which update-menus 2>/dev/null`" ]; then
     4if [ "$1" = "configure" ] && [ -x "$(which update-menus 2>/dev/null)" ]; then
    55        update-menus
    66fi
  • trunk/linux/tested/DEBIAN/postrm

    r7506 r15916  
    22set -e
    33# Automatically added by dh_installmenu
    4 if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
     4if [ -x "$(which update-menus 2>/dev/null)" ]; then update-menus ; fi
    55# End automatically added section
  • trunk/linux/tested/usr/bin/josm

    r15914 r15916  
    1 #!/bin/sh
     1#!/bin/bash
    22# Simple wrapper script used to start JOSM in Debian
    33set -e
     
    55# First, the alternative (if known to work) or users preference as defined by $JAVA_HOME. Next, use OpenJDK.
    66# Override to a specific one using $JAVACMD
    7 ALTERNATIVE_JDK="`readlink -n -f /etc/alternatives/java`"
     7ALTERNATIVE_JDK=$(readlink -n -f /etc/alternatives/java)
    88
    99# Let's get the current architecture -- needed for multiarchified Java
    10 ARCH="`dpkg --print-architecture 2> /dev/null || true`"
     10ARCH=$(dpkg --print-architecture 2> /dev/null || true)
    1111
    1212JAVA_CMDS="$JAVA_HOME/bin/java"
    1313
    1414# 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 ; then
     15if dpkg --get-selections "openjdk-*-jre" | grep install$ > /dev/null \
     16|| dpkg --get-selections "openjdk-*-jre:$ARCH" | grep install$ > /dev/null ; then
    1717        # LTS versions in decreased order
    1818        JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-11-openjdk/bin/java /usr/lib/jvm/java-11-openjdk-$ARCH/bin/java"
     
    3838if [ -z "${JAVACMD}" ]; then
    3939    for jcmd in $JAVA_CMDS; do
    40         if [ "z$ALTERNATIVE_JDK" = "z`readlink -n -f $jcmd`" ] && [ -z "${JAVACMD}" ]; then
     40        if [ "z$ALTERNATIVE_JDK" = "z$(readlink -n -f "$jcmd")" ] && [ -z "${JAVACMD}" ]; then
    4141            JAVACMD="$jcmd"
    4242            break
     
    4747if [ -z "${JAVACMD}" ]; then
    4848    for jcmd in $JAVA_CMDS; do
    49         if [ -x "$jcmd" -a -z "${JAVACMD}" ]; then
     49        if [ -x "$jcmd" ] && [ -z "${JAVACMD}" ]; then
    5050            JAVACMD="$jcmd"
    5151            break
     
    5656if [ "$JAVACMD" ]; then
    5757    echo "Using $JAVACMD to execute josm." || true
    58     if [ "`expr match \"${JAVACMD}\" 'java-9'`" != "0" ] || [ "`expr match \"${JAVACMD}\" 'java-10'`" != "0" ]; then
     58    if [[ "${JAVACMD}" =~ 'java-9' ]] || [[ "${JAVACMD}" =~ 'java-10' ]]; then
    5959        JAVA_OPTS="--add-modules java.activation,java.se.ee $JAVA_OPTS"
    60     elif [ "`expr match \"${JAVACMD}\" 'java-1'`" != "0" ]; then
     60    elif [[ "${JAVACMD}" =~ 'java-1' ]]; then
    6161        JAVA_OPTS="--add-modules java.scripting,java.sql $JAVA_OPTS"
    6262    fi
    6363    set +e
    6464    while true; do
    65         $JAVACMD $JAVA_OPTS -jar /usr/share/josm/josm.jar "$@"
     65        $JAVACMD "$JAVA_OPTS" -jar /usr/share/josm/josm.jar "$@"
    6666        if [ "z$?" != "z9" ]; then
    6767            break
  • trunk/scripts/optimize-images

    r13283 r15916  
    11#!/bin/sh
    22
    3 for x in $(find images/ -name "*.png"); do
    4     echo "Processing ${x}"
    5     optipng -o7 -quiet "${x}"
    6 done
     3find images/ -name "*.png" \
     4  -exec echo "Processing {}" \; \
     5  -exec optipng -o7 -quiet "{}" \;
Note: See TracChangeset for help on using the changeset viewer.