Modify

Opened 3 months ago

Closed 3 months ago

#15233 closed defect (fixed)

[patch] Fix bashism in josm launcher

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.

Attachments (1)

bashisms.patch (836 bytes) - added by sebastic 3 months ago.

Download all attachments as: .zip

Change History (7)

Changed 3 months ago by sebastic

Attachment: bashisms.patch added

comment:1 Changed 3 months ago by sebastic

Description: modified (diff)

comment:2 Changed 3 months ago by bastiK

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

comment:3 Changed 3 months ago by Don-vip

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 Changed 3 months ago by Don-vip

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

comment:5 Changed 3 months ago by Don-vip

Description: modified (diff)

comment:6 Changed 3 months ago by Don-vip

Resolution: fixed
Status: newclosed

In 12717/josm:

fix #15233 - Fix bashism in josm launcher (patch by sebastic)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain bastiK.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.