This reverts commit 59ac24e243.
FPATH variable cannot be handled within autoinit process as this is not
an environment variable. Thus when modulecmd.tcl is executed, it does
not know the current value of FPATH. So if it sets FPATH during
autoinit, previous value of this variable is lost. As a result FPATH
must stay defined in initialization script.
According to ShellCheck's documentation:
When command expansions are unquoted, word splitting and globbing will occur.
This often manifests itself by breaking when filenames contain spaces.
Related: https://www.shellcheck.net/wiki/SC2046
Related: #470
Some variables, that were unquoted intentionally were converted to arrays.
According to ShellCheck's documentation:
Quoting variables prevents word splitting and glob expansion, and prevents
the script from breaking when input contains spaces, line feeds, glob
characters and such.
Related: https://www.shellcheck.net/wiki/SC2086
Related: #470
These occurrences do not seem to cause any problems described below but
let's still fix it for the sake of consistency within this script.
According to ShellCheck's documentation:
ShellCheck noticed that you have used a variable as an array, but then assign
it a string. array=foo is equivalent to array[0]=foo, and leaves the rest
of the elements unaffected.
Related: https://www.shellcheck.net/wiki/SC2178
Related: #470
According to ShellCheck's documentation:
-a and -o in [ .. ] test expressions are not well defined, and can cause
incorrect results when arguments start with dashes or contain !.
Related: https://www.shellcheck.net/wiki/SC2166
Related: #470
According to ShellCheck's documentation:
Bourne shells are very whitespace sensitive. Adding or removing spaces can
drastically alter the meaning of a script.
Related: https://www.shellcheck.net/wiki/SC1035
Related: #470
According to ShellCheck's documentation:
Different shells support different features. To give effective advice,
ShellCheck needs to know which shell your script is going to run on.
Related: https://www.shellcheck.net/wiki/SC2148
Related: #470
Use install command rather mkdir or cp to apply regular file mode when
installing Modules. A specific umask configuration set in the current
environment will not impact modes set on installed files.
Follow same approach than Makefiles generated by autotools, with an
INSTALL Makefile variable.