Commit Graph

2133 Commits

Author SHA1 Message Date
Xavier Delaruelle
d0fc0be445 contrib: fix var unbound issue on 'mt' with older bash 2019-07-02 20:22:34 +02:00
Xavier Delaruelle
62098ccf09 travis: optionally change clone dir
To launch tests from path containing specific chars (with special
meaning in regular expressions) to ensure expected results from test
cases are correctly escaped.
2019-07-02 08:11:32 +02:00
Xavier Delaruelle
93fc35f8b1 ts/travis: adapt tests to search_match cfg 2019-07-02 08:11:32 +02:00
Xavier Delaruelle
1c152bbe74 doc: desc search_match in NEWS/MIGRATING 2019-07-02 05:39:15 +02:00
Xavier Delaruelle
b3a8547997 doc: desc search_match in man/diff/INSTALL 2019-07-02 05:39:15 +02:00
Xavier Delaruelle
3ba2851767 Add ability to control module search match
Introduce the ability to control the module search match. Search query
string should match module name start or any part of module fully
qualified name. Default search match behavior is set at ``./configure``
time with the ``--with-search-match`` option. It could be superseded
with the ``MODULES_SEARCH_MATCH`` environment variable, that could be
set with ``config`` module sub-command through the ``search_match``
option. Command-line switches ``--starts-with`` (``-S``) and
``--contains`` (``-C``) for ``avail`` module sub-command enable to
supersede defined search match configuration.
2019-07-02 05:39:15 +02:00
Xavier Delaruelle
0c81f3b171 Rework no-indepth mod match in getModules
Match search query at corresponding search depth level when indepth mode
is disabled without implying that search query matches beginning of
module names. This is a preparatory work to a search match option where
query could be contained in module name and not only be the start of
module name.

As some results from findModules are removed through the process of
getModules, update element list of directories to fit results.
2019-07-02 05:39:15 +02:00
Xavier Delaruelle
5b4831873e Args after var name are values on {append,prepend,remove}-path
Fix argument parsing for the `append-path`, `prepend-path` and
`remove-path` modulefile commands to consider every arguments found
after the variable name as variable values and not command option even
if argument starts with `-` character.

Fixes #278.
2019-06-28 21:42:58 +02:00
Xavier Delaruelle
fe6b808aa6 Trim modfile magic cookie string from # chars
Right trim '#' characters from the fetched modulefile magic cookie
string to ensure a correct compatibility version comparison. Useful when
modulefile first line is equal to '#%Module4.3##############'.

Thanks to Eric Deveaud for the issue report.
2019-06-26 06:44:41 +02:00
Xavier Delaruelle
e5aa32eb2a Report locked config option value with a locked mention 2019-06-08 08:04:49 +02:00
Xavier Delaruelle
ae2c0045a8 Raise error when setting locked config option
Raise an error and exit if module 'config' sub-command attempts to
modify a configuration option which is locked.
2019-06-08 08:04:49 +02:00
Xavier Delaruelle
a665e6b8b4 install: enable implicit_default in locked_configs
Makes implicit_default configuration option lockable through
locked_configs option.
2019-06-08 08:04:49 +02:00
Xavier Delaruelle
1a52463b96 install: replaces --enable-extra-siteconfig with --with-locked-configs
Add to the configure script the --with-locked-configs option to ignore
environment variable superseding of Modules configurations defined in
modulecmd.tcl script. Lockable configuration option are extra_siteconfig.
Currently locked options are reported through the locked_configs option
on the config sub-command.

This new configure option replces --enable-extra-siteconfig which was
dedicated to the control over the MODULES_SITECONFIG variable.
2019-06-08 08:04:49 +02:00
Xavier Delaruelle
4df560d862 doc: clarify source sub-cmd in module.1 man
Talk about scriptfile on `source` sub-command rather modulefile to
clarify a bit usage.
2019-06-03 21:52:27 +02:00
Xavier Delaruelle
43f60de81a doc: desc implicit_default in NEWS/MIGRATING 2019-06-03 08:14:59 +02:00
Xavier Delaruelle
09dc1ac724 ts/travis: adapt tests to implicit_default cfg 2019-06-03 08:14:59 +02:00
Xavier Delaruelle
e9a24722e6 Force implicit_default enablement during 'restore'
When performing a 'module restore', forcibly enable the implicit_default
option to correctly match current state against the collection to
restore, even if this collection was saved with implicit_default enabled
and current setup at restore time has this option disabled.

implicit_default is then restored to its defined value once the match
is over. So the load of a module to restore from the collection may fail
when implicit_default is disabled if this module is an implicit default
and collection was saved with implicit_default enabled.
2019-06-03 08:14:59 +02:00
Xavier Delaruelle
89fef8de6c doc: desc implicit_default in man/diff/INSTALL 2019-06-03 08:14:59 +02:00
Xavier Delaruelle
51c56f66ee Control whether an implicit default should be selected
Add the ability to configure whether an implicit default version should
be defined for modules with no default version explicitly defined. When
enabled, which stays the default behavior, a module version is
automatically selected (latest one) when the generic name of the module
is passed. When implicit default selection is disabled, the name of
modules to evaluate should be fully qualified elsewhere an error is
returned. This option is set at `./configure` time with the
`--enable-implicit-default` and `--disable-implicit-default` options. It
could be superseded with the `MODULES_IMPLICIT_DEFAULT` environment
variable, that could be set with `config` module sub-command throught the
`implicit_default` option.

When implicit_default is disabled:
- module implicit default versions are excluded from 'module avail -d'
  results.
- false is returned when argument passed to the 'is-avail' sub-command
  is a directory without an explicit default set in it.
- and auto_handling is enabled, the requirement load mechanism will fail
  on requirement relying on module implicit default version

Fixes #179.
2019-06-03 08:14:59 +02:00
Xavier Delaruelle
305569db12 Add report_issue arg to getPathToModule proc
Add the report_issue argument to the getPathToModule procedure to
inhibit the report of issue raised during the search and resolution of a
passed module name.

Issue report is unwanted when performing a reverse lookup of the module
names resolving to a known modulefile (like done in procedures
getSimplifiedLoadedModuleList and getAllModuleResolvedName).

Issue report is also disabled in cmdModuleSearch, as found issues are
reported later on through the list returned by the getPathToModule call.
2019-05-30 18:48:23 +02:00
Xavier Delaruelle
91635c4a4e ts/travis: adapt tests to unload_match_order cfg 2019-05-26 07:33:07 +02:00
Xavier Delaruelle
d107029a81 doc: desc unload_match_order in NEWS/MIGRATING 2019-05-26 07:33:07 +02:00
Xavier Delaruelle
8fd5d94fb7 doc: update unload-firstly-loaded recipe with unload_match_order cfg 2019-05-26 07:33:07 +02:00
Xavier Delaruelle
410fa99867 doc: desc unload_match_order in man/diff/INSTALL 2019-05-26 07:33:07 +02:00
Xavier Delaruelle
b66a6e25ac Add the ability to configure of unload match order
Add the ability to configure when unloading a module and multiple loaded
modules match request if firstly loaded module should be choosen or
lastly loaded module. Default behavior is set at the `./configure` time
with the `--with-unload-match-order` switch. This default could be
superseded with the `MODULES_UNLOAD_MATCH_ORDER` environment variable,
that could be set with `config` module sub-command throught the
`unload_match_order` option.

This change allows to restore behavior of Modules compatibility version
where first matching module in loaded module list were unloaded in such
situation.

By default, lastly loaded module is set for unload (like it was
before this change) to limit impact on the loaded module list when
dependencies are woven between these loaded modules.

Even if this change enables to change the default behavior, it is highly
recommanded to keep it as soon your modulefiles express dependencies
between each other.

Fixes #198.
2019-05-26 07:33:07 +02:00
Xavier Delaruelle
2e870ca50d doc: desc fix for #270 in NEWS 2019-05-24 08:01:02 +02:00
Xavier Delaruelle
eab4c6fb0e ts: clean any automated handling mode configuration 2019-05-22 07:30:29 +02:00
Jacques Raphanel
bd2034371f contrib: add support for creating module file skeleton from MSDOS prompt
Update createmodule.py to provide support for cmd shell to use `set`
instead of `env`.

Fixes #270.
2019-05-21 09:23:02 +02:00
Xavier Delaruelle
07803f7cbb doc: desc config cmd in NEWS/MIGRATING 2019-05-21 08:20:53 +02:00
Xavier Delaruelle
38eeac41e4 ts: test 'config' sub-command 2019-05-20 20:36:56 +02:00
Xavier Delaruelle
3640b2d798 ts: outputs full log in 'mt' if testsuite failed but no failure found 2019-05-20 20:36:56 +02:00
Xavier Delaruelle
2579e7604f doc: desc config cmd in man module.1 2019-05-20 20:36:56 +02:00
Xavier Delaruelle
065528372a Reword configuration 'key' into configuration 'option' 2019-05-20 20:36:56 +02:00
Xavier Delaruelle
9865ca6012 install: provide a bare siteconfig.tcl
Provide a bare siteconfig.tcl in designated etcdir at installation time
if no pre-existing site-specific configuration file is found at
designated location.
2019-05-20 20:36:56 +02:00
Xavier Delaruelle
8f8b74398a Add ability to disallow MODULES_SITECONFIG
Add to the configure script the `--enable-extra-siteconfig` and
`--disable-extra-siteconfig` options to allow or forbid the definition
of a site-specific configuration script controlled with the
`MODULES_SITECONFIG` environment variable.

These options control the default value of the `g_extrasiteconfig`
variable in `modulecmd.tcl`. If this variable is true (by default),
MODULES_SITECONFIG is looked at the siteconfig sourcing time. Thus the
primary siteconfig.tcl can set the variable to false to ensure the
extra siteconfig is disabled whatever the option passed at ./configure
time.
2019-05-20 20:36:56 +02:00
Xavier Delaruelle
1cadbab8bd doc: desc config sub-cmd in diff_v3_v4 2019-05-19 10:46:35 +02:00
Xavier Delaruelle
5826bb20e8 Report and set 'extra_siteconfig' on 'config' sub-command
Report and be able to set the 'extra_siteconfig' configuration, linked
to the MODULES_SITECONFIG environment variable, on the 'config'
sub-command.
2019-05-19 10:46:35 +02:00
Xavier Delaruelle
ffdb0b5aef Fix block report line split when output color 2019-05-19 10:46:35 +02:00
Xavier Delaruelle
aa3edd7cc4 doc: desc. MODULECONTACT/MODULERCFILE in module.1 2019-05-15 20:53:33 +02:00
Xavier Delaruelle
5ae6a886f0 doc: provide 'config --dump-state' result when reporting issue 2019-05-15 20:50:30 +02:00
Xavier Delaruelle
c8aa9491f2 Dump machine/os/tcl_version state on 'config' sub-cmd 2019-05-15 20:50:30 +02:00
Xavier Delaruelle
d3527425fd Report and set 'rcfile' on 'config' sub-command
Report and be able to set the 'rcfile' configuration, linked to the
MODULERCFILE environment variable, on the 'config' sub-command.
2019-05-15 20:50:30 +02:00
Xavier Delaruelle
43b2760353 init: add 'config' sub-cmd to shell comp scripts 2019-05-15 20:50:29 +02:00
Xavier Delaruelle
c31c7d4706 Rework cmdModuleConfig argument parsing
To handle the definition of empty value.
2019-05-15 20:43:53 +02:00
Xavier Delaruelle
7e364ee624 Add the ability to report one config on 'config' sub-cmd
When just a configuration key name is passed to the 'config' sub-command
(and no value associated to it) just report this configuration key value
rather reporting all configuration keys.
2019-05-15 20:43:52 +02:00
Xavier Delaruelle
7b4d52d846 Add ability to unset conf from 'config' sub-cmd
When the '--reset' command-line switch and a configuration key name is
passed to the 'config' sub-cmd, unset the relative environment variable.
Ensure this configuration key could be altered.
2019-05-15 20:43:52 +02:00
Xavier Delaruelle
2bb4a169a2 Reword cmdModuleConfig data structure
Split details in multiple arrays for modularity.
2019-05-15 20:43:52 +02:00
Xavier Delaruelle
db17229ce3 Rework displayConfig procedure
Pass configuration value directly and re-order arguments.
2019-05-15 20:43:52 +02:00
Xavier Delaruelle
3e4ef46c8f Add ability to set conf from 'config' sub-cmd
When a configuration key name and value is passed to the 'config'
sub-command, set the relative environment variable with passed value.
Ensure on the way that configuration key name can be altered with an
environment variable and that passed value is valid.
2019-05-15 20:43:52 +02:00
Xavier Delaruelle
bb1a193394 Report Modules env variable on config --dump-state
Report the list of the environment variables related to Modules in an
additionnal table displayed on the --dump-state action of the 'config'
sub-command.
2019-05-15 20:43:52 +02:00