Commit Graph

46 Commits

Author SHA1 Message Date
Xavier Delaruelle
3a85fb43fd lint: fix SC2268 shellcheck warning 2023-05-19 21:36:11 +02:00
Xavier Delaruelle
24df443fc6 lint: fix SC2124 shellcheck warning 2023-05-19 21:36:11 +02:00
Xavier Delaruelle
2b90613169 lint: fix SC2086 shellcheck warning 2023-05-19 21:36:11 +02:00
Xavier Delaruelle
818da9a4c4 lint: fix SC2034 shellcheck warning 2023-05-18 20:28:10 +02:00
Xavier Delaruelle
52fda4787a doc: fix logging sys on log-module-command recipe
Update log-module-command recipe to ensure the logging system is not
broken by the current user environment.

Fixes #475.
2022-10-14 06:50:37 +02:00
Lukáš Zaoral
d018f7a9e6 lint(ShellCheck): fix SC2086 info diagnostic
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
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
5939a00154 lint(ShellCheck): fix SC2155 warning
According to ShellCheck's documentation:

In the original code, the return value of mycmd in $(mycmd) is ignored,
and export will instead always return true.  This may prevent conditionals,
set -e and traps from working correctly.

Related: https://www.shellcheck.net/wiki/SC2155
Related: #470
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
7418b3fce0 lint(ShellCheck): fix SC2128 warning
These occurrences do not cause any problems described below but it's better
to be verbose that we indeed want to access the first array element.

According to ShellCheck's documentation:

When referencing arrays, $myarray is equivalent to ${myarray[0]} --
it results in only the first of multiple elements.

Related: https://www.shellcheck.net/wiki/SC2128
Related: #470
2022-09-02 09:52:05 +02:00
Lukáš Zaoral
a45f186200 lint(ShellCheck): fix SC2148 error
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
2022-09-02 09:52:05 +02:00
Xavier Delaruelle
9bff25c2d2 doc: fix log-module-command recipe siteconfig.tcl
Fix the siteconfig.tcl file of the log-module-command cookbook recipe
not to break when a file is sourced through cmdModuleSource. Limit the
addition of the 'auto' log field only if load evaluation comes from
cmdModuleLoad procedure.

Fixes #453
2022-04-28 08:55:10 +02:00
Dimitri Papadopoulos
e9a6678eec Fix typos found by codespell 2022-02-15 05:54:03 +01:00
Xavier Delaruelle
6c6e0764b7 doc: update setenv in top-priority-values recipe config 2021-11-20 18:03:47 +01:00
Xavier Delaruelle
e2bc6a8d09 doc: update top-priority-values recipe config
Update the siteconfig.tcl configuration of top-priority-values cookbook
recipe after the add-path/unload-path changes.
2021-11-20 18:03:36 +01:00
Xavier Delaruelle
b688be67d8 doc: extend *Log module commands* cookbook
Improve the *Log module commands* cookbook to rely on the `trace` Tcl
command to track every modulefile evaluation and module/ml procedure
calls.

Fixes #412.
2021-09-19 14:32:01 +02:00
Xavier Delaruelle
919662c3c2 doc: desc setup with shell-specific scripts in cookbook
Update the *Source script in modulefile* cookbook recipe to add it a
*Usage with shell-specific scripts* section that demonstrate how to use
modulefiles with `source-sh` commands when software provide a specific
initialization script for each shell it supports.

Take this opportunity to improve the readability of this recipe by
coloring/highlighting shell session examples.

Fixes #399.
2021-05-30 15:16:33 +02:00
Xavier Delaruelle
e2117723b3 doc: fix modulecmd state check in recipe code
Code to handle the internal states of modulecmd have been reworked on
Modules v4.6. As a consequence several siteconfig.tcl extension scripts
described on documentation recipes have to be adapted.

Closes #396
2021-05-09 12:52:04 +02:00
Xavier Delaruelle
777fc4adf2 doc: add *sticky modules* cookbook recipe 2021-04-05 22:31:54 +02:00
Xavier Delaruelle
778dac700a doc: add hidden-loaded example on hide/forbid recipe 2020-12-18 18:59:11 +01:00
Colin Marquardt
517c208f7a doc: use versioned cookie+getenv in test-modulefiles rcp
Use versioned magic cookie and getenv over $env
2020-11-17 06:34:48 +01:00
Xavier Delaruelle
4f99282692 doc: update new-features-without-breaking-old-module recipe
Describe use of new ModuleTool and ModuleToolVersion Tcl variables as
well as versioncmp modulefile command.
2020-11-15 10:03:31 +01:00
Xavier Delaruelle
d44a4b7f51 doc: add 'hide-and-forbid-modules' cookbook recipe 2020-11-14 15:23:09 +01:00
Xavier Delaruelle
20405b7b83 doc: add 'new-features-without-breaking-old-module' recipe 2020-10-01 21:14:27 +02:00
Xavier Delaruelle
44c9147ee8 Apply inclusive terminology in code and docs
Use inclusive terminology [1] to eliminate 'master' and 'slave' terms as
much as possible from code and documentation. 'master' has been changed
into 'main' and 'slave' into 'subordinate' or 'sub'.

After this change, some references to the 'master' and 'slave' word can
still be found in repository:
* `slaves` sub-command of `interp` Tcl command
* `--slave` option of `update-alternatives tool in RPM spec file
* `master_doc` attribute of Sphinx `conf.py` file
* git 'master' branch need to be renamed and tools referring it need to
  be updated accordingly (configure, script/mpub, script/mrel)

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=49decddd39e5f6132ccd7d9fdc3d7c470b0061bb
2020-07-16 21:31:30 +02:00
Xavier Delaruelle
d15b7c6494 doc: add source-script-in-modulefile recipe 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
46332f0237 doc: refer to more generic vers name in compiler-etc-depend recipe 2020-02-21 22:41:46 +01:00
Xavier Delaruelle
2c7be3d319 doc: improve console output reading of compiler-etc-depend recipe 2020-02-21 22:41:46 +01:00
Xavier Delaruelle
410bd79d5e doc: normalize code of modulefile of compiler-etc-depend recipe
And include these modulefile examples as Tcl code in recipe document to
get their content highlighted.
2020-02-21 22:41:46 +01:00
Xavier Delaruelle
996c1ddc21 doc: normalize code of Tcl lib of compiler-etc-depend recipe
Add authorship information, same header and comment structure for all
Tcl files to include these files in cookbook recipe document with Tcl
syntax highlight.
2020-02-21 22:41:46 +01:00
Xavier Delaruelle
f046cd833c doc: simplify reading of compiler-etc-depend recipe (trailing space) 2020-02-21 22:41:46 +01:00
Xavier Delaruelle
e451b7754c doc: simplify reading of compiler-etc-depend recipe (dummy) 2020-02-21 22:41:46 +01:00
Tom Payerle
f2272eb917 doc: add compiler-etc-dependencies cookbook recipe
New cookbook discussing various strategies for creating modulefiles for
packages with multiple builds depending on previously loaded compiler,
MPI libraries etc. (E.g. handling different "flavors" of packages)
2020-02-21 22:41:46 +01:00
Colin Marquardt
9b2cad1d7d doc: highlight code included in cookbook recipes
Specify language directive for included Tcl script files in cookbook
recipes to get their code highlighted in resulting HTML documents. As
Pygment Tcl lexer used by Sphinx does not support the whole Tcl syntax,
scripts of modulepaths-persist-over-sudo and test-modulefiles recipes
have been adapted to enable highlighting. Change has not been performed
over the expose-procs-vars-to-modulefiles and top-priority-values
recipes as their code cannot be adapted to match lexer needs.
2020-01-08 23:07:23 -07:00
Xavier Delaruelle
4466e4a996 doc: add sc19 demo 2019-11-21 06:32:37 -07:00
Xavier Delaruelle
5ee94baa05 doc: adapt ensure-user-qualify-modules recipe to config rework 2019-10-13 10:46:08 +02:00
Xavier Delaruelle
06c6e63faa doc: add module-info-name-return-basename recipe
Fixes #297.
2019-10-13 10:42:47 +02:00
Tom Payerle
0b6f21481c doc: Adding cookbook page "tips-for-code-reuse" 2019-09-17 08:01:27 +02:00
Xavier Delaruelle
79d8f0ab9b doc: add ensure-user-qualify-modules recipe to cookbook 2019-09-14 18:53:35 +02:00
Xavier Delaruelle
3d75225cae doc: add modulepaths-persist-over-sudo recipe to cookbook
Rework global RC file proposed in contrib/etc/rc-modulepath, for use
case described at [1], as a cookbook recipe.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1139165
2019-09-14 10:48:15 +02:00
Xavier Delaruelle
5eff0bc163 doc: add expose-procs-vars-to-modulefiles recipe to cookbook 2019-09-13 19:09:41 +02:00
Xavier Delaruelle
778aeecf26 doc: add log-module-commands recipe to cookbook
Fixes #283.
2019-09-12 21:21:44 +02:00
Colin Marquardt
7863e78b5b doc: add cookbook recipe for ModulesTest
Fixes #182.
2019-07-07 19:44:18 +02:00
Xavier Delaruelle
846f95108f Report auto mech warn/err to top level message block
During an additional evaluation triggered by an automated module
handling mechanism, ensure warning and error messages are reported under
the message block of the main evaluation.

Add a 'recordtop' argument to the reportWarning and reportError
procedures in order to indicate that the message should be recorded
under the top-level message block instead of the currently active
message block.

Fixes #252.
2019-04-21 19:11:34 +02:00
Xavier Delaruelle
9f638b8118 doc: add example modulefiles for 'flavored-modules' recipe 2019-03-16 15:31:35 +01:00
Xavier Delaruelle
4e432320e5 doc: mention author of modulefiles-in-git examples 2019-02-25 10:54:32 +01:00
Scott Johnson
ac0a3f7bb5 New cookbook entry for versioning Modulefiles with Git
Originally developed at:
https://github.com/scottj97/environment-modules-in-git
2019-02-25 10:54:32 +01:00
Xavier Delaruelle
8c9df050f9 doc: introduce cookbook
Add a cookbook section in the documentation and port there the 3
pre-existing recipes: inhibit-report-info, top-priority-values and
unload-firstly-loaded.

Move the examples files of these recipes from contrib/cookbook to
doc/example directory.
2018-11-19 04:02:06 +01:00