ocamlfind icon indicating copy to clipboard operation
ocamlfind copied to clipboard

Apply Shellcheck improvement suggestions

Open Leonidas-from-XIV opened this issue 1 year ago • 2 comments

I ran shellcheck on the configure script which suggested a lot of nice improvements, mostly about quoting and making sure spaces don't break the commands.

Other interesting improvements include removing variables that are never set (thus always empty, which made it work), so removing them makes it easier to see what is happening.

Edit: I also applied the $? suggestion since it makes the code a bit less fragile and fixed the POSIX compatibility, so it should be as portable as it was before.

Leonidas-from-XIV avatar Feb 28 '24 10:02 Leonidas-from-XIV

FYI, I tried to change the quoting stuff (i.e. ` ` vs $()) in the OCaml codebase many years ago and it supposedly break some systems in /bin/sh scripts, see this comment.

zapashcanon avatar Sep 09 '24 18:09 zapashcanon

6 years later, the quoting concerns for backticks are somewhat less of a concern - I think the intersection of "has a C11 compiler and can therefore build OCaml 5.x" and "has a non-Posix sh" is fortunately ∅ 😊

dra27 avatar Sep 23 '24 08:09 dra27