Commit Graph

4391 Commits

Author SHA1 Message Date
Xavier Delaruelle
67d0410d3f doc: MODULES_ML has to get set prior Modules init 2022-03-11 18:04:41 +01:00
Xavier Delaruelle
cee28d7364 doc: clarify config opt linked to install opt 2022-03-11 18:04:41 +01:00
Xavier Delaruelle
c07b0b3b8f doc: clarify env vars to set prior Modules initialization 2022-03-09 07:08:51 +01:00
Xavier Delaruelle
d629c2b15e doc: clarify module-generated env vars in module(1) 2022-03-09 07:08:51 +01:00
Xavier Delaruelle
88a72d3733 doc: clarify config opt linked to env var
Update the ENVIRONMENT section in module(1) man page to provide for each
Modules environment variable the name of the configuration option that
could be used to set the variable through the config sub-command.
2022-03-09 07:08:50 +01:00
Xavier Delaruelle
c0ca0400fa doc: magic cookie means file signature
Update documentation to clarify that the Modules magic cookie
corresponds to a file signature.
2022-03-09 07:08:27 +01:00
Xavier Delaruelle
86fb5e05c5 install: exclude git hook stuff from git export 2022-03-05 10:54:50 +01:00
Xavier Delaruelle
024fc61bfa script: add commit-msg hook script to check commit msg 2022-03-05 10:54:49 +01:00
Xavier Delaruelle
db43f9815b script: update pre-commit to spell check docs with Aspell 2022-03-05 09:37:41 +01:00
Xavier Delaruelle
f45d8b6375 script: pre-commit warn if codespell not installed 2022-03-05 09:37:41 +01:00
Xavier Delaruelle
3bbac40541 doc: desc. Dependencies between modulefiles
Fixes #431.
Fixes #433.
2022-03-04 07:34:26 +01:00
Xavier Delaruelle
0bc1f54bdd doc: fix typos found with Aspell 2022-03-04 06:33:39 +01:00
Xavier Delaruelle
ff6a1362b7 script: add pre-commit script to verify commits 2022-03-02 07:31:30 +01:00
Xavier Delaruelle
d38233c7d9 Handle empty fish shell function in sh-to-mod/source-sh
Update the sh-to-mod and source-sh mechanism to handle fish shell
function with an empty body.
2022-03-02 07:31:30 +01:00
Xavier Delaruelle
353652651e doc: desc. recent sh-to-mod/source-sh fixes in NEWS 2022-03-01 19:40:44 +01:00
Xavier Delaruelle
5e58c0c782 Include private functions in fish sh-to-mod analysis
Update the environment analysis made for sh-to-mod sub-command and
source-sh modulefile command for fish shell to include the private
functions. Catch this way all definition that may be used to set shell
completion.
2022-03-01 19:40:44 +01:00
Xavier Delaruelle
e3e012929a ts: test unload of source-sh mods in install ts 2022-02-28 21:13:58 +01:00
Xavier Delaruelle
88977b2324 gh: upgrade to python 3.9 on Cygwin
Seem a new python37-sphinx release on Cygwin has broken dependencies, so
upgrate Cygwin test cases to python 3.9 which is the recommanded version.
2022-02-28 07:53:32 +01:00
Xavier Delaruelle
a6b868e89c codespell: ignore spack/miniconda3/OpenFOAM-dev content 2022-02-28 07:15:57 +01:00
Xavier Delaruelle
8466cc8b44 install/ts: test source-sh over OpenFOAM scripts 2022-02-28 07:15:57 +01:00
Xavier Delaruelle
1a2eb7579d ts: test source-sh over Conda script on ksh/zsh/tcsh/fish 2022-02-26 12:41:20 +01:00
Xavier Delaruelle
2b334858d1 Fix csh alias detection on source-sh
Alias definition may sometimes be enclosed in parenthesis on csh shell.
Fix alias parsing regexp to support such definition.

Useful for Conda initialization script for csh shell: conda shell alias
definition is presented by csh shell enclosed in parenthesis.

Fixes #434.
2022-02-26 12:40:09 +01:00
Xavier Delaruelle
95d3d80d3c install/ts: fetch/install Conda/Spack for source-sh tests
Add directives into Makefile to fetch and install Spack and Conda in
order to test source-sh feature against their profile scripts.
2022-02-25 14:49:39 +01:00
Xavier Delaruelle
7ddba79233 ts: test fish complete def without -c when fish>=3.2
Test fish shell completion definition without -c/--complete option when
fish is >=3.2 instead of >=3.0.
2022-02-25 14:03:40 +01:00
Xavier Delaruelle
972b97f720 ts: test source-sh over Conda scripts in install ts 2022-02-25 14:03:40 +01:00
Xavier Delaruelle
d7139065e2 cirrus: upgrade linux test env to ubuntu 20.04 2022-02-25 14:03:40 +01:00
Xavier Delaruelle
9f5295c158 ts: fix autoinit tests after modulecmd.tcl output quoting 2022-02-24 19:07:03 +01:00
Xavier Delaruelle
b7e52ac6b0 ts: update install tests after modulecmd.tcl output quoting 2022-02-24 18:54:25 +01:00
Xavier Delaruelle
cd4015b106 Revert work on noglob_eval_shells config option
Remove entirely the work on the noglob_eval_shells option as enclosing
in quotes the generated output of modulecmd.tcl to pass it to the eval
command is equivalent to disable the pathname expansion mechanism of
sh-kind shells.
2022-02-24 18:24:47 +01:00
Xavier Delaruelle
661c47aa17 init: translate `` into $() for sh-kind shells 2022-02-24 17:46:41 +01:00
Xavier Delaruelle
a0fc740bca doc: translate `` into $() for sh-kind shells 2022-02-24 17:46:41 +01:00
Xavier Delaruelle
10d76bd77c Translate `` into $() for sh-kind shells
As the module shell function code is currently updated for sh-kind
shells, take this opportunity to translate the `cmd` execution syntax
into the more modern $(cmd) syntax.
2022-02-24 17:46:37 +01:00
Xavier Delaruelle
c77d6b889c ts: test ksh/zsh over Spack scripts in install ts 2022-02-24 14:12:36 +01:00
Xavier Delaruelle
b8099c25e7 Enclose modulecmd.tcl output in quotes on sh-kind shells
Update the module shell function definition for sh-kind shell to enclose
the output generated by modulecmd.tcl in quotes in order to pass it to
the eval command.

Quoting code to pass it to eval brings correctness to the definition of
shell functions without harming already well functionning definition.
Regular shell function definition could now be correctly defined in user
environment: no more need to get each command line in these function
ending with a ';' character.

Same mechanism was applied in initialization script to evaluate the code
produced by the autoinit sub-command.

Multiple function-definition issues spotted when using source-sh across
environment setting script shell are fixed with this change.

Moreover, all the noglob_eval_shells work is made useless with this
change as no globbing is applyed to the code produced by modulecmd.tcl
as it is now enclosed in quotes.
2022-02-24 14:11:40 +01:00
Xavier Delaruelle
695238dbf8 ts: test wildcard char in func on sh-to-mod tests 2022-02-24 12:19:57 +01:00
Xavier Delaruelle
58ea6e8224 ts: test wildcard char in envvar on sh-to-mod tests 2022-02-24 11:24:33 +01:00
Xavier Delaruelle
f3fac879f5 ts: test source-sh over Spack scripts in install ts 2022-02-22 14:20:36 +01:00
Xavier Delaruelle
7fd9077ee2 doc: desc. MODULES_NOGLOB_EVAL_SHELLS in changes 2022-02-21 09:30:24 +01:00
Xavier Delaruelle
344df27801 ts: test sh-to-mod against fish nested func/_ in name 2022-02-21 08:40:46 +01:00
Xavier Delaruelle
10ff350932 Correctly escape [ and | in builtin fish funcs
Update execShAndGetEnv to correctly escape the '[' and '|' characters in
fish shell code to filter builtin commands. These character were not
correctly escaped previously (replaced by '$1').
2022-02-21 08:40:46 +01:00
Xavier Delaruelle
f8ef97a973 Remove dup ';' in execShAndGetEnv getfunc fish code 2022-02-21 08:40:46 +01:00
Xavier Delaruelle
ead35d9659 Fix fish builtin func withdrawal on sh-to-mod/source-sh
Fix the fish code to withdraw builtin functions to compare functions
defined before and after fish script shell execution in execShAndGetEnv
procedure.

Previous regexp was not matching the full string, so every function
whose name contained a substring equal to the name of a builtin function
(like '_') where filtered.
2022-02-21 08:40:46 +01:00
Xavier Delaruelle
e94bab9fc8 Support fish nested function on sh-to-mod/source-sh
On fish shell, function definition can be embedded inside function
definition. Update the execShAndGetEnv procedure to add a string
separated after each function definition (%ModulesSubShToMod%) to
clearly delimitate the shell function to analyse and report and skip the
definition of nested functions.
2022-02-21 08:40:46 +01:00
Xavier Delaruelle
c454d57110 cirrus/gh: remove broken snapd fish config
Remove snapd file that breaks fish shell on bionic (see
https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1961365).
2022-02-21 08:40:46 +01:00
Xavier Delaruelle
a1e2d91a5e ts: add install tests for noglob_eval_shells 2022-02-19 19:25:58 +01:00
Xavier Delaruelle
c80f663356 ts: test noglob_eval_shells over autoinit subcmd 2022-02-19 15:56:44 +01:00
Xavier Delaruelle
b479d07e05 ts: test noglob_eval_shells config option 2022-02-19 15:56:44 +01:00
Xavier Delaruelle
f4630b2df6 doc: desc. noglob_eval_shells in man/changes/NEWS 2022-02-19 15:56:44 +01:00
Xavier Delaruelle
3eb823bf91 doc: desc. --with-noglob-eval-shells option in INSTALL 2022-02-19 15:56:44 +01:00
Xavier Delaruelle
3ed83f232f Disable pathname expansion prior shell eval
Add code in module shell function (for shells listed in
noglob_eval_shells) to disable pathname expansion for the time of
produced shell code evaluation.
2022-02-19 15:56:44 +01:00