Opened 8 years ago

Last modified 8 years ago

#15233 closed defect

[patch] Fix bashism in josm launcher — at Version 5

Reported by: sebastic Owned by: bastiK
Priority: normal Milestone: 17.09
Component: Ubuntu package Version:
Keywords: linux shell bash Cc: sebastic

Description (last modified by Don-vip)

The recent Java 9 change (SVN r12591) to the josm launchers introduced a bashism, the test only works when bash is configured as /bin/sh:

$ checkbashisms linux/*/usr/bin/josm*
possible bashism in linux/latest/usr/bin/josm-latest line 49 (alternative test command ([[ foo ]] should be [ foo ])):
    if [[ $JAVACMD == *"java-9"* ]]; then
possible bashism in linux/latest/usr/bin/josm-latest line 49 (should be 'b = a'):
    if [[ $JAVACMD == *"java-9"* ]]; then
possible bashism in linux/tested/usr/bin/josm line 49 (alternative test command ([[ foo ]] should be [ foo ])):
    if [[ $JAVACMD == *"java-9"* ]]; then
possible bashism in linux/tested/usr/bin/josm line 49 (should be 'b = a'):
    if [[ $JAVACMD == *"java-9"* ]]; then

The attached patch changes the test to use expr(1) which should be portable to all shells.

Change History (6)

by sebastic, 8 years ago

Attachment: bashisms.patch added

comment:1 by sebastic, 8 years ago

Description: modified (diff)

comment:2 by bastiK, 8 years ago

Summary: Fix bashism in josm launcher[patch] Fix bashism in josm launcher

comment:3 by Don-vip, 8 years ago

Keywords: linux shell bash added

Thanks for the tip. I will call checkbashisms in our Jenkins job to avoid this issue in the future.

comment:4 by Don-vip, 8 years ago

Done. If it works, job for r12715 should become unstable and we should see 4 warnings of type "Bashism" appear.

comment:5 by Don-vip, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.