| Summary: | With `set -u` set, the launch script fails | ||
|---|---|---|---|
| Product: | Geant4 | Reporter: | Michael Reilly <OmnipotentEntity> |
| Component: | cmake | Assignee: | Ben Morgan <Ben.Morgan> |
| Status: | CLOSED FIXED | ||
| Severity: | minor | ||
| Priority: | P4 | ||
| Version: | 10.6 | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Attachments: |
Patch to fix the described issue.
Corrected patch to fix |
||
This patch is erroneous. The constructs ${FOO+} should be ${FOO-}, please forgive me for being bad at shell scripting.
Created attachment 606 [details]
Corrected patch to fix
Thanks for the patch (and correction)! I've tested and applied these on Gitlab, so after testing they should go into the upcoming 10.6.1 patch release. I'll mark as RESOLVED FIXED once that's complete. Thanks for the merge. I've tested 10.6.1, and it's working great! Just a friendly reminder, this bug is probably good to close. I can't mark it as RESOLVE FIXED. I can only do RESOLVED, or else I would have done it myself. Thanks! Markin as such. |
Created attachment 603 [details] Patch to fix the described issue. Some administration policies and distributions ensure that `set -u` is set by default. Unfortunately, this causes the following shell script code (and similar constructs elsewhere in the file) to fail: `if test "x$LD_LIBRARY_PATH" = "x"; then` if the variable in question isn't defined, (which is precisely what this command is testing for). The attached patch modifies these lines to be: `if [ -z "${LD_LIBRARY_PATH+}" ]; then` Which is (as far as I can determine) the proper way of testing if a variable is either undefined or empty. This variable expansion should even be available under the Bourne Shell, if my research is correct, but I have not tested specifically this, as on my distribution (and most others) /bin/sh is just a symlink to bash. The quotes are unnecessary in this case, but I thought it made the intent a little more clear.