Commit Graph

2802 Commits

Author SHA1 Message Date
Xavier Delaruelle
37c4e33b3a doc: desc. module-info user{name,groups} in MIGRATING 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
87f8e51823 ts/lib: test tcl ext lib against a zero res getgroups call
Add an utility library that supersedes the getgroups function from libc.
The getgroups function from this added library always returns an empty
result (0). It is used for coverage test of the getgroups call made
within the Envmodules_InitStateUsergroupsObjCmd function of the Tcl
extension library.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
f29f51ee36 travis/appveyor/cirrus: use --base64-failed-log mt opt 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
97f8dc7e25 script: add option --base64-failed-log to mt
Add option ``--base64-failed-log`` to the ``mt`` script to output test
log on failure in a base64 serialized format.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
1675363e0e ts/lib: test tcl ext lib against a failed getgrgid call
Add an utility library that supersedes the getgrgid function from libc.
The getgrgid function from this added library always returns an error
(NULL). It is used for coverage test of the getgrgid call made within the
Envmodules_InitStateUsergroupsObjCmd function of the Tcl extension
library.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
166096f4d8 ts/lib: test tcl ext lib against a failed getgroups call
Add an utility library that supersedes the getgroups function from libc.
The getgroups function from this added library always returns an error
(-1). It is used for coverage test of the getgroups call made within the
Envmodules_InitStateUsergroupsObjCmd function of the Tcl extension
library.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
4542008335 ts/lib: test tcl ext lib against a failed getpwuid call
Add an utility library that supersedes the getpwuid function from libc.
The getpwuid function from this added library always returns an error
(NULL). It is used for coverage test of the getpwuid call made within
the Envmodules_InitStateUsernameObjCmd function of the Tcl extension
library.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
f5fc37ee41 doc: mark subcmd/mfcmd/command in NEWS/MIGRATING
Improve markup of NEWS and MIGRATING documents starting from this 4.6
version to enable references to module sub-commands, command line
switches, environment variables and modulefile Tcl commands.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
97cc536a89 doc: desc. module-info usergroups/username in NEWS 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
db9384f186 script: fix distclean err to ignore in mrel/mpub 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
b34595dec9 script: add cleaning of prev built rpm in 'mrel' 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
88b77b7a5d ts: adapt stack trace msgs to tcl vers in 50/{286,287} 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
9cda3f0dbb ts: test module-info user{name,groups} on win platform 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
1e319459ad ts: test 'module-info usergroups' in 50/287 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
d3276559c5 ts: test 'module-info username' in 50/286 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
452b3ffb25 lib: implement initStateUsergroups
Add function in libtclenvmodules to implement `initStateUsergroups` as a
Tcl command, which provides a more efficient way to retrieve current
groups of running process, rather forking to execute `id` external
binary.

Note that if current system does not support the `getgroups` system
call, only the primary group name of current user will be returned.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
11e6099aec lib: Implement initStateUsername
Add function in libtclenvmodules to implement `initStateUsername` as a
Tcl command, which provides a more efficient way to retrieve current
username, rather forking to execute `id` external binary.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
8e0e1d5bf8 Raise error if module-info usergroups/username called from win 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
76e4d10d16 doc: desc. module-info usergroups/username in modulefile(4) 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
16368cfc32 doc: reorder module-info sub-cmd desc. in modulefile(4) 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
eb4e830590 doc: desc. module-info username/usergroups in diff doc 2020-07-16 21:53:51 +02:00
Xavier Delaruelle
b200e5749f Add 'usergroups' sub-cmd to module-info command
Be able to fetch groups of current user through `module-info` modulefile
command. With no extra argument, all group names are returned. If a name
is provided as argument, true is returned if this name matches one entry
in the group list, false is returned otherwise.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
56e73a7c26 Add 'usergroups' state
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).
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
d52f2fc863 Add 'username' sub-cmd to module-info command
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.
2020-07-16 21:53:51 +02:00
Xavier Delaruelle
5a8527d4b5 Add 'username' state
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).
2020-07-16 21:53:51 +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
6d8f72b950 doc: desc. recent doc and configure script updates in NEWS 2020-07-07 18:38:41 +02:00
Xavier Delaruelle
efb64c83a5 ts: fix install quar test when LD_PRELOAD is set 2020-07-07 15:09:42 +02:00
Xavier Delaruelle
43c1a3eb46 install: disable compat version build by default
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.
2020-07-07 09:39:46 +02:00
Xavier Delaruelle
bba8c028b8 travis: use '--arg val' configure syntax on 2 test cases 2020-07-07 09:39:46 +02:00
Xavier Delaruelle
23776df5f7 install: set dir arg with '--arg val' form in configure
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
2020-07-07 09:39:31 +02:00
Xavier Delaruelle
4d8421c25c travis: fix --with-quarantine-vars arg bad definition 2020-07-07 09:39:31 +02:00
Xavier Delaruelle
71fb69944f install: show lib/compat configure args on configure 2020-07-07 09:39:26 +02:00
Xavier Delaruelle
e5947537e8 install: raise error on unknown configure argument
Fixes #348
2020-07-07 09:39:04 +02:00
Xavier Delaruelle
0f79bed5a3 install: limit compat args to those supported in configure
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.
2020-07-07 09:38:56 +02:00
Xavier Delaruelle
a44f1fd195 doc: use brighter variation of red svg logo
Built from CMYK EPS file.
2020-06-27 08:27:40 +02:00
Xavier Delaruelle
8e5a3b531a doc: include logo on README 2020-06-24 08:45:24 +02:00
Xavier Delaruelle
b0d2fe921c doc: fix html theme on RTD
To avoid RTD to override html_theme_options when html_theme is set to
'default'.
2020-06-24 08:03:58 +02:00
Xavier Delaruelle
fd7ba8de87 doc: include logo in doc portal 2020-06-24 07:50:09 +02:00
Xavier Delaruelle
d15b7c6494 doc: add source-script-in-modulefile recipe 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
fdebca9005 doc: desc. source-sh in MIGRATING/NEWS 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
fcc2a32686 doc: desc. source-sh/MODULES_LMSOURCESH in man/diff 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
98846cd6b1 doc: desc. env recording in source-sh design doc 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
38fa4a3356 ts: fix result order on 50/400 tests 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
01a89ccc92 ts: adapt 50/400 err stack trace msg to Tcl version used 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
03f5dd9af8 ts: test var relying on source-sh script defined var 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
33d4db3ec1 ts: add 'display' mode test for source-sh cmd 2020-06-01 21:03:12 +02:00
Xavier Delaruelle
866a7d8e93 Implement 'source-sh' for display mode
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.
2020-06-01 21:03:12 +02:00
Xavier Delaruelle
7133bab420 Split sh-to-mod code in 2 procs
Separate script evaluation and output extraction in a dedicated
procedure called execShAndGetEnv.
2020-06-01 21:03:12 +02:00
Xavier Delaruelle
71d48f03c0 ts: test 'source-sh' modulefile command 2020-06-01 21:03:12 +02:00