Create `usergroups` state to collect all the groups the user running
modulecmd.tcl process is member of. Add an initStateUsergroups procedure
to initialize this state, which calls `id -G -n` to fetch these group
names. This external command is available on every Unices and its
`-G -n` arguments operate the same way.
An error will be obtained on Windows platform as `id` command is not
known there.
initStateUsergroups procedure is recorded in modulecmd.tcl as
__initStateUsergroups and renamed if initStateUsergroups procedure is
not found from Modules Tcl extension library. A more efficient version
of initStateUsergroups will be provided in the library later on (not to
depend on an external command call).
Be able to fetch current username through `module-info` modulefile
command. With no extra argument, username is returned. If a name is
provided as argument, true is returned if this name matches current
username, false is returned otherwise.
Create `username` state to collect the name of the user running
modulecmd.tcl process. Add an initStateUsername procedure to initialize
this state, which calls `id -u -n` to fetch username. This external
command is available on every Unices and its `-u -n` arguments operate
the same way.
An error will be obtained on Windows platform as `id` command is not
known there.
initStateUsername procedure is recorded in modulecmd.tcl as
__initStateUsername and renamed if initStateUsername procedure is not
found from Modules Tcl extension library. A more efficient version of
initStateUsername will be provided in the library later on (not to
depend on an external command call).
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
Version 4 of Modules is available since almost 3 years. Many
improvements have been made to integrate features of version 3.2 still
needed in module command. So it is now time to disable the build of
version 3.2 which was triggered by default since 4.0.
Enable the definition of the installation directory argument of the
./configure script with the `--arg val` syntax form in addition to the
`--arg=val` syntax.
Fixes#348
Only pass to compatibility version ./configure script arguments that
make sense to it. Do not transmit anymore arguments that are unknown to
this compatibility version ./configure script.
Compatibility version ./configure script argument listed in project's
main configure script are only a subset of supported arguments. Main
configure script can only be used to run compatibility configure script
with the argument list here.
When modulefile is displayed, report modulefile commands resulting from
source-sh script evaluation rather source-sh modulefile command.
As for unload modulefile evaluation, display mode relies on
MODULES_LMSOURCESH if modulefile is currently loaded. However it will
requery script to fetch the definition of shell aliases and functions.
Transform character used as separator to structure MODULES_LMSOURCESH
environment variable value (:, & and |), when these characters are used
among values set by source-sh scripts. Respectively transform these
characters into `<EnvModEscPS>`, `<EnvModEscS1>` and `<EnvModEscS2>`.
Rely on information saved in MODULES_LMSOURCESH environment variable to
know what to undo when modulefile is evaluated in unload mode. Evaluate
source-sh resulting modulefile commands through unload Tcl interpreter
to get those command reversed.
Record in user environment the modulefile commands resulting from
source-sh evaluations. Making this information persist in environment
via MODULES_LMSOURCESH variable helps to determine what to undo when
unloading modulefiles making use of the source-sh command.
For path-like variable set by sourced script, the newly added path
entries are analyzed to remove duplicates among the same portion to
avoid a path to be prepended multiple times or appended multiple times.
Deduplication does not apply between prepended portion and appended
portion. Path entries found set prior script sourced are also excluded
from deduplication process.
Sourced scripts may detect the need to update PS1, but this decision is
taken over a specific environment where initialization scripts have not
been evaluated for the shells.
sh shell on BSD platform outputs alias definition with different
character escaping than regular sh or dash on Linux platform.
Disable test for this shell on this platform currently. Will see later
on if a need to support this shell is needed.