Modify

Opened 7 years ago

Closed 7 years 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 7 years ago.

Download all attachments as: .zip

Change History (7)

by sebastic, 7 years ago

Attachment: bashisms.patch added

comment:1 by sebastic, 7 years ago

Description: modified (diff)

comment:2 by bastiK, 7 years ago

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

comment:3 by Don-vip, 7 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, 7 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, 7 years ago

Description: modified (diff)

comment:6 by Don-vip, 7 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.