Commit Graph

101 Commits

Author SHA1 Message Date
Xavier Delaruelle
b2bb071782 New year copyright mention update 2018-01-13 16:51:49 +01:00
Xavier Delaruelle
9c45a20bb2 doc: desc MODULES_CMD var and modulecmd wrapper 2018-01-04 07:15:37 +01:00
Xavier Delaruelle
627aee1abf doc: update diff_v3_v4 with 4.1 changes so far 2017-12-30 22:15:06 +01:00
Xavier Delaruelle
8864cd19e1 doc: desc. variable ref support in MODULEPATH 2017-12-30 14:13:36 +01:00
Xavier Delaruelle
353b9d662c Introduce @etcdir@/siteconfig.tcl script
Add the possibility to setup a site-specific configuration Tcl script
which will be sourced at the start of modulecmd.tcl. This site-specific
Tcl script enables to supersede global variable and procedure definition
made in modulecmd.tcl. This way local adaptations can be made without
editing the modulecmd.tcl script.

'--etcdir' configure option is added to specify the location of the
site-specific configuration script.
2017-12-23 18:22:20 +01:00
Xavier Delaruelle
3fcc9b46e7 Add --index opt to remove-path
Remove path entry in environment variable by passing an index rather a
string. String at specified index in content list is removed if coherent
with relative reference counter.
2017-12-21 05:43:13 +01:00
Xavier Delaruelle
b2105b8834 Introduce --duplicates opt to {append,prepend}-path
Let the possibility to append or prepend path element entry to a
variable even if this entry is already registered into the variable
which introduces duplicates element within the variable value.

Entries are added with eventual duplication by the use of the
--duplicate option on append-path and prepend-path commands. These
additions increment the reference counter as usual.

Removal of duplicated path entry depends on the reference counter value.
Entries are not removed unless reference counter value is lesser than
the number of duplicated entries.
2017-12-19 21:34:52 +01:00
Xavier Delaruelle
8c4b3b745d Pass multi paths in multi strs on {append,prepend,remove}-path
Enable append-path, prepend-path and remove-path to receive multiple
path value arguments.

Add some non-regression tests for modulefile or sub-command cases.

Update modulefile.4 and module.1 docs.

Closes #141
2017-12-19 06:53:50 +01:00
Xavier Delaruelle
f13fac6235 Pass multiple paths in 1 str on {append,prepend,remove}-path
Detect if path string passed to append-path, prepend-path or remove-path
commands is composed of multiple path entries (separated by specified or
default delimiter string). In this situation add/remove each path
separately to correctly update relative reference counter.

Add some non-regression tests for modulefile or sub-command cases.

Update modulefile.4 doc.

Closes #142
2017-12-17 16:20:52 +01:00
Xavier Delaruelle
9dcc70165b Introduce MODULES_COLLECTION_PIN_VERSION
Add the ability to always record module name + version even if this
version corresponds to the default one.

By default, version number is omitted if it corresponds to the implicit
or explicitly set default version. If MODULES_COLLECTION_PIN_VERSION
environment variable is set to 1, version number is always recorded.

When restoring a collection, we do not know for sure if it was saved
with pinned versions or not, so module load and unload movements are
determined on both simplified or raw module list. Results with less
module to load or unload (means with more matches between module lists)
are kept.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.

Closes #89
2017-12-12 07:28:28 +01:00
Xavier Delaruelle
e2dbdbdaa5 doc: fix info-loaded section layout in module.1 2017-12-06 07:22:06 +01:00
Xavier Delaruelle
73456fea04 Handle no argument case on 'is-used'
Returns true when no argument is passed to 'is-used' if any directory
is used, whatever it is.

Adapt docs and test cases to this new behavior.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.

Closes #144
2017-12-01 15:47:23 +01:00
Xavier Delaruelle
ec305b5296 Handle no argument case on 'is-saved'
Returns true when no argument is passed to 'is-saved' if any collection
matching currently set collection target exists whatever this collection
is.

Adapt docs and test cases to this new behavior.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-12-01 15:46:47 +01:00
Xavier Delaruelle
ea7e9a7792 Handle no argument case on 'is-loaded'
Returns true when no argument is passed to 'is-loaded' if any modulefile
is loaded, whatever it is.

Adapt docs and test cases to this new behavior.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-12-01 15:45:42 +01:00
Xavier Delaruelle
a481df0ecb Introduce 'info-loaded' as module sub-command
Like for 'is-loaded', register 'module-info loaded' modulefile Tcl
command as a module sub-command to make it reachable from the command
line. Sub-command is named 'info-loaded' for sake of efficiency (not
'module-info-loaded').

Add the new command to the existing shell completion scripts (bash, tcsh
fish, zsh).

Document new command in the module.1 man page.

Check 'info-loaded' command argument error in 071-args tests of 00-init
suite. Test 'module info-loaded' cannot be called from a modulefile with
151-module-onlytop in 50-cmds suite. Add 156-info-loaded tests in
70-maint suite to validate new sub-command.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.

Closes #3
2017-12-01 08:07:39 +01:00
Xavier Delaruelle
2dcd8da58d Introduce 'module-info loaded' modulefile command
Add 'loaded' sub-command to the 'module-info' modulefile Tcl command.
This new sub-command returns name of the modules currently loaded
corresponding to the name passed as argument. May return multiple
modules if passed name matches more than one loaded modules.

Document new command in modulefile.4 and test it with a 285-info-loaded
tests in 50-cmds suite.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-30 17:16:24 +01:00
Xavier Delaruelle
a4929a13b9 Introduce 'is-avail' as module sub-command
Like for 'append-path', register 'is-avail' modulefile Tcl command as a
module sub-command to make it reachable from the command line.

Add the new command to the existing shell completion scripts (bash, tcsh
fish, zsh).

Document new command in the module.1 man page.

Check 'is-avail' command argument error in 071-args tests of 00-init
suite. Test 'module is-avail' cannot be called from a modulefile with
151-module-onlytop in 50-cmds suite. Add 155-is-avail tests in 70-maint
suite to validate new sub-command.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-28 20:56:45 +01:00
Xavier Delaruelle
1b9420b500 Add 'is-avail' modulefile command
Introduce 'is-avail' modulefile command to check, following the same
spirit than 'is-loaded', if any of the passed modulefiles exists in
enabled in MODULEPATH.

Document new command in modulefile.4 and test it with a 322-is-avail
tests in 50-cmds suite.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-28 07:27:04 +01:00
Xavier Delaruelle
0cff43a864 Introduce 'is-used' as module sub-command
Like for 'append-path', register 'is-used' modulefile Tcl command as a
module sub-command to make it reachable from the command line.

Add the new command to the existing shell completion scripts (bash, tcsh
fish, zsh).

Document new command in the module.1 man page.

Check 'is-used' command argument error in 071-args tests of 00-init
suite. Test 'module is-used' cannot be called from a modulefile with
151-module-onlytop in 50-cmds suite. Add 154-is-used tests in 70-maint
suite to validate new sub-command.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-28 07:26:56 +01:00
Xavier Delaruelle
24cb3d86e2 Add 'is-used' modulefile command
Introduce 'is-used' modulefile command to check, following the same
spirit than 'is-loaded', if any of the passed directories has been
enabled in MODULEPATH.

Document new command in modulefile.4 and test it with a 321-is-used
tests in 50-cmds suite.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-28 07:26:49 +01:00
Xavier Delaruelle
1b468822ed Introduce 'is-saved' as module sub-command
Like for 'append-path', register 'is-saved' modulefile Tcl command as a
module sub-command to make it reachable from the command line.

Add the new command to the existing shell completion scripts (bash, tcsh
fish, zsh).

Document new command in the module.1 man page.

Check 'is-saved' command argument error in 071-args tests of 00-init
suite. Test 'module is-saved' cannot be called from a modulefile with
151-module-onlytop in 50-cmds suite. Add 154-is-saved tests in 70-maint
suite to validate new sub-command.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-28 07:26:39 +01:00
Xavier Delaruelle
db9b86632e Add 'is-saved' modulefile command
Introduce 'is-saved' modulefile command to check, following the same
spirit than 'is-loaded', if any of the passed collections exists.

Document new command in modulefile.4 and test it with a 320-is-saved
tests in 50-cmds suite.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-27 06:57:15 +01:00
Xavier Delaruelle
100d9223b1 Introduce 'is-loaded' as module sub-command
Like for 'append-path', register 'is-loaded' modulefile Tcl command as a
module sub-command to make it reachable from the command line.

Improve 'cmdModuleResurface' procedure to set a global 'g_return_false'
flag when 'is-loaded' command returns 0. If 'g_return_false' flag is set
shell code rendering will end with a false value returned.

Add the new command to the existing shell completion scripts (bash, tcsh
fish, zsh).

Document new command in the module.1 man page.

Check 'is-loaded' command argument error in 071-args tests of 00-init
suite. Test 'module is-loaded' cannot be called from a modulefile with
151-module-onlytop in 50-cmds suite. Add 153-is-loaded tests in 70-maint
suite to validate new sub-command.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.

Closes #116
2017-11-26 16:01:57 +01:00
Xavier Delaruelle
62334ed0f7 Improve new {append,prepend,remove}-path commands
Refactor code to call from the module command line modulefile-specific
commands. These commands can only be called from the command line, not
when calling 'module' procedure from a modulefile, to avoid any
ambiguity.

When parsing command line arguments, check context to know if '-d' means
'--default' (avail command) or '--delim' (*-path commands).

Add the new commands to the existing shell completion scripts (bash,
tcsh, fish, zsh).

Document new commands in the module.1 man page.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-26 10:40:29 +01:00
Xavier Delaruelle
eafd2c89a8 doc: desc MODULES_SILENT_SHELL_DEBUG in module.1 and NEWS 2017-11-15 08:23:40 +01:00
Xavier Delaruelle
062570c3c7 doc: reorder env var in module.1 2017-11-13 06:01:50 +01:00
Xavier Delaruelle
bc04fe0dd1 doc: describe quar-related variables in module.1 2017-11-13 05:56:25 +01:00
Xavier Delaruelle
b7e474ca89 Fix no branch name for version release on RTD builds 2017-11-01 17:13:51 +01:00
Xavier Delaruelle
3c77ba2760 Correct version release tag in Makefile and Sphinx 2017-11-01 15:35:30 +01:00
Xavier Delaruelle
d8887d345f Introduce pager support
Paginate stderr output into paging command, using 'less' by default,
following the same fashion and behavior than 'git' command.

Pager is enabled by default in modulecmd script. New global variables
'g_use_pager', 'g_pager' and 'g_pager_opts' control default behavior of
module command.

Pager is enabled only if stderr stream is attached to a terminal.

Pager setup can then be superseeded by environment variables. If LESS
variable is set and paging command is set to 'less', default pager
options are cleared to use those defined in LESS variable.

If MODULES_PAGER variable is defined, its value superseeds paging
activation, command and options. If this variable is empty, paging is
disabled.

If PAGER variable is defined and MODULES_PAGER is unset, PAGER value
superseeds paging activation, command and options. If this variable is
empty, paging is disabled.

Default behavior and MODULES_PAGER or PAGER environment variables can be
superseeded by command-line options: --paginate to enable paging and
--no-pager to disable it.

When pager is enabled, a pipe file descripted is ignited to the paging
command and option for stderr stream. Once set, this file descriptor is
used by all report procedures to output message content, rather using
stderr.

modulecmd command-line parse has been revised not to output message
during argument treatment. Debug, warning and error messages are saved
to then be displayed once pager setup is achieved.

An 'initPager' procedure is introduced to configure then start paging.
A 'cleanupAndExit' is added to close pager before exiting if pager has
been started.
2017-10-28 15:53:27 +02:00
Xavier Delaruelle
a7dbbf2ad9 doc: add intro and refine toc of index page 2017-10-15 21:28:37 +02:00
Xavier Delaruelle
29f9afe7c6 doc: migrate NEWS doc from TXT to RST 2017-10-14 09:40:29 +02:00
Xavier Delaruelle
897084023f doc: migrate INSTALL doc from TXT to RST 2017-10-14 09:29:42 +02:00
Xavier Delaruelle
2f6bf21b77 doc: migrate MIGRATING doc from MD to RST
To integrate it into sphinx process and make it available on the Web.
2017-10-14 09:29:42 +02:00
Xavier Delaruelle
67b40c920f doc: define sphinx required minimal version in conf 2017-10-13 22:00:34 +02:00
Xavier Delaruelle
95043aafae doc: detail path variable elt counter in man-pages 2017-10-10 08:11:14 +02:00
Xavier Delaruelle
5d15d242b5 doc: mention output redirection in migrate and diff 2017-10-10 06:56:36 +02:00
Xavier Delaruelle
f913532caf doc: add FAQ imported from SF wiki 2017-10-07 19:19:33 +02:00
Xavier Delaruelle
0afa66b5a4 install: no mention of master git branch in vers num 2017-10-07 16:33:36 +02:00
Xavier Delaruelle
eb5849ec92 install: adapt doc build process to sphinx
Change makefile to build doc with sphinx rather pod. Docs are now
pregenerated in dist-tarball, to avoid requiring documentation build
tool when installing from these dist-tarball.

Adapt travis conf & RPM spec file to the new documentation build
process.
2017-10-07 15:11:19 +02:00
Xavier Delaruelle
42044724dd doc: introduce sphinx configuration
To build existing manpages and diff_v3_v4 document.
2017-10-07 15:11:19 +02:00
Xavier Delaruelle
941cfb2b3f doc: migrate from pod to rst
Transform source documents from POD format to reStructuredText to then
benefit from Sphinx documentation framework and Read The Docs publishing
capabilities.
2017-10-07 15:10:22 +02:00
Xavier Delaruelle
ce1da74cf4 doc: add EXIT STATUS section in module.1 2017-09-29 08:00:43 +02:00
Xavier Delaruelle
3cc6984fea doc: describe modulefiles hiding feature
In MIGRATING guide and diff reference doc.
2017-09-29 07:11:49 +02:00
Xavier Delaruelle
06693a77e3 doc: avail/apropos/whatis support glob patterns 2017-09-27 06:18:22 +02:00
Xavier Delaruelle
d2ed5dc59e doc: clarify submod unload during switch command 2017-09-27 06:03:33 +02:00
Xavier Delaruelle
2a430cdd8c doc: rename diff_with_c-version to diff_v3_v4 2017-09-25 18:23:48 +02:00
Xavier Delaruelle
065353ed19 doc: improve diff doc with more changes between 3.2 & 4 2017-09-22 21:48:17 +02:00
Xavier Delaruelle
93cde2ef61 doc: rephrase diff to talk about Modules 3.2 and 4 2017-09-22 21:32:38 +02:00
Xavier Delaruelle
e67cc001b1 doc: describe MODULES_USE_COMPAT_VERSION in module.1 2017-09-22 21:32:38 +02:00