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 )
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)
Change History (7)
by , 7 years ago
Attachment: | bashisms.patch added |
---|
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Summary: | Fix bashism in josm launcher → [patch] Fix bashism in josm launcher |
---|
comment:3 by , 7 years ago
Keywords: | linux shell bash added |
---|
comment:4 by , 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 , 7 years ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.
Thanks for the tip. I will call
checkbashisms
in our Jenkins job to avoid this issue in the future.