Commit Graph

243 Commits

Author SHA1 Message Date
Xavier Delaruelle
5654e9ef1a install: add --emacsdatadir/--enable-emacs-addons options
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2025-06-15 08:02:30 +02:00
Xavier Delaruelle
c6db5358e5 doc: add manual page for "envml" command
Fixes #190

Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2025-06-13 07:19:38 +02:00
Xavier Delaruelle
ad9a3cfce6 install/ts: fix Spack installation for test purpose
Now a specific package repository is fetched when Spack is first used.
Make this initialization happen at install time, rather during the first
source-sh test.

Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2025-06-12 07:07:59 +02:00
Xavier Delaruelle
bbc7cb1266 ts: remove default_modulecmd and expect MODULECMD env var to be set
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2025-05-10 14:37:26 +02:00
Xavier Delaruelle
c94541d9f0 install: add --enable-spider-indepth configure option
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2024-12-27 10:17:08 +01:00
Xavier Delaruelle
7aad7338b3 Add support for linting modulecache files
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2024-12-04 08:17:01 +01:00
Xavier Delaruelle
37a1d12c75 install: add --with-spider-{terse-,}output configure options
Introduce the --with-spider-output and --with-spider-terse-output
configure options to choose at installation time the default list of
elements to report on spider command.

Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2024-11-16 21:21:36 +01:00
Xavier Delaruelle
6988ab4294 install: use newer version of nagelfar (1.3.5)
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
2025-02-13 19:40:54 +01:00
Xavier Delaruelle
9206a1688a Rename "contrib" directory into "share"
Give a more clear name to the "contrib" directory that contains
architecture and configuration independent data. New directory name is
"share", which correctly matches the destination of these files into the
installation directory.
2024-12-08 10:39:56 +01:00
Xavier Delaruelle
5b7fe98096 Rework reloading procs to pass them value list
Instead of passing a variable name as argument to
reloadModuleListLoadPhase and reloadModuleListUnloadPhase, simply pass
them a value list.
2024-10-11 08:30:56 +02:00
Xavier Delaruelle
fbb2068bd1 Save props of reloading mods in global array
Save properties of reloading modules (is user asked, variant list and
extra tag list) in a global array g_savedPropsOfReloadMod rather than
returning these information in local arrays are that then transmitted to
the reloading phase.
2024-10-11 08:30:56 +02:00
Xavier Delaruelle
372ad6ffc4 Add lprepend helper proc 2024-10-11 08:30:56 +02:00
Xavier Delaruelle
08a996e474 install: add --enable-conflict-unload configure option
Introduce the --enable-conflict-unload configure option to choose at
installation time if conflict should be automatically unloaded or not.
Option is disabled by default.
2024-10-11 08:29:46 +02:00
Simon Maertens
a66905338c install: add Windows install/testinstall scripts for pwsh 2024-09-15 15:02:51 +02:00
Xavier Delaruelle
70ecd34698 Add requested argument to execute-modulefile
Update execute-modulefile procedure to add requested argument. This
piece of information tells if the evaluation has been requested by user
or if it is an automatically triggered evaluation.

Internal evaluation (refresh, scan and whatis) are considered auto
evaluations.
2024-06-13 04:55:13 +02:00
Xavier Delaruelle
f086234448 install: add --with-logged-events configure option
Introduce the --with-logged-events configure option to choose at
installation time the default list of events to log. Default is ''.
2024-06-13 04:55:13 +02:00
Xavier Delaruelle
8d44da1b3e install: add --with-logger{,-opts} configure options
Introduce the --with-logger and --with-logger-opts configure options to
choose at installation time the default logger command and its options
to use to log information. Default logger is 'logger' and its default
options are '-t modules'.
2024-06-13 04:55:13 +02:00
Xavier Delaruelle
e70de65618 install/gh: create dummy mogui-cmd in bindir for tests 2024-06-12 06:43:01 +02:00
Xavier Delaruelle
692d55514c ts: use fixed version of OpenFOAM for source-sh tests
As OpenFOAM is currently changing the way it initializes its
environment, fix use of previous version for the sake of our source-sh
tests.
2024-06-09 14:25:19 +02:00
Xavier Delaruelle
097b1dc13f Revert "lib: use getgrouplist to fetch user's groups"
Revert use of getgrouplist C function instead of getgroups. getgrouplist
returns a result different than the one obtained with "id" command on
some OSes (FreeBSD, Cygwin, MSYS).

Stay with getgroups for the moment, as it is still the standard way
(POSIX.1-2008) to retrieve user groups.
2024-05-11 16:22:54 +02:00
Xavier Delaruelle
258a392620 lib: use getgrouplist to fetch user's groups
Update Envmodules_InitStateUsergroupsObjCmd to rely on getgrouplist C
function rather getgroups. getgrouplist seems to be a more modern
function to get user's groups. It automatically includes primary group
if not part of supplementary groups. No duplicate result are returned.
2024-05-11 16:21:58 +02:00
Xavier Delaruelle
00e8d8c911 lib: call getgroups to determine number of groups
Update Envmodules_InitStateUsergroupsObjCmd to make a first dummy call
to "getgroups" function in order to retrieve the number of groups and
then be able to allocate the right array size.

With such change, our function does not rely anymore on sysconf function
and on NGROUPS_MAX and DEFAULT_MAXGROUPS defines.
2024-05-11 16:21:38 +02:00
Xavier Delaruelle
548bda7832 install: rename error_on_multi_load into abort_on_error 2023-11-27 20:19:05 +01:00
Xavier Delaruelle
0914bb2976 Split mfinterp.tcl.in file into interp.tcl.in + mfcmd.tcl 2023-11-27 20:05:34 +01:00
Xavier Delaruelle
5cc55ee5f1 install: add --enable-source-cache configure option
Introduce the --enable-source-cache configure option to enable at
installation time the source_cache option. Option is disabled by
default.
2023-11-27 07:26:19 +01:00
Laurent
ac158798ff Modulefile man page moved from man4 to man5
modulefile man page is currently in the section 4 of man. According to
"man man", this is incorrect, as section 4 is for "Special files (usually
found in /dev)". The man page for modulefile should be in section 5,
"File formats and conventions, e.g. /etc/passwd".

This patch moves modulefile(4) to modulefile(5).

Fixes #518
2023-11-15 15:37:00 +01:00
Xavier Delaruelle
47568ac0cb install: add Makefile rule to build Nagelfar syntaxdb
Make a specific Nagelfar syntaxdb for modulecmd.tcl development. Gather
all procedure definitions as Tcl code is split in several files merged
to build modulecmd.tcl.
2023-09-02 09:22:49 +02:00
Xavier Delaruelle
ae2165dfb8 install: add --with-error-on-multi-load configure option
Introduce the --with-error-on-multi-load option to choose at
installation time the default error behavior when loading multiple
modulefiles. Default behavior is "continue".
2023-08-17 20:59:35 +02:00
Xavier Delaruelle
fce86de163 install: add --enable-unique-name-loaded configure option
Introduce the --enable-unique-name-loaded configure option to choose at
installation time to enable the unique_name_loaded configuration option
which allows only one module loaded per module name.

Configure option is disabled by default.
2023-07-16 09:03:13 +02:00
Xavier Delaruelle
95fe2a308f install: add --with-sticky-purge configure option
Introduce the --with-sticky-purge configure option to choose at
installation time the default error behavior when unloading a sticky
module during a purge command. Allowed values are error (default),
warning and silent.
2023-07-08 15:12:36 +02:00
Xavier Delaruelle
8f9fd54a67 install: zip ChangeLog file to reduce install size
Install ChangeLog.gz zipped documentation file instead of ChangeLog to
reduce installation size (-1.5 MB).

As a result, gzip becomes mandatory when building Modules from git
repository.
2023-05-20 15:38:58 +02:00
Xavier Delaruelle
2b079a0215 Add modscan.tcl code file
Add modscan.tcl code file that will host Tcl procedures for the scan
modulefile evaluation mode and the extra match search process.
2023-04-14 06:21:07 +02:00
Xavier Delaruelle
64888c94b5 install: allow to build from short-depth git repo
Fix Makefile to allow building Modules from a git repository with short
commit depth.

Fixes #486
2023-03-04 15:30:44 +01:00
Xavier Delaruelle
affeb8a994 Add major.minor version number in cache files
Append major.minor version number to the #%Module header prefix of
generated cache files. Cache file can be used only if generated for the current
release of Modules used.

Change cache.tcl into cache.tcl.in to get Modules release number
resolved at build time.
2022-11-30 08:07:12 +01:00
Xavier Delaruelle
4c92b082d9 Core code for cmdModuleCacheclear
Implement cacheclear sub-command. For each modulepath enabled, check
module cache file exists. If yes and if modulepath is writable for user,
try to delete the cache file.

Report message block is used to report file deletion. Reports are output
in normal verbosity level or higher. A warning message is emitted if
modulepath is not writable for user.

Add tcl/cache.tcl source file to store procedure related to cache
mechanism. Update Makefile to properly generate modulecmd.tcl with this
new tcl file.
2022-11-28 03:58:56 +01:00
Xavier Delaruelle
3b1faeb181 Use main as new name for default git branch 2022-10-30 13:26:31 +01:00
Xavier Delaruelle
dfef714243 install: use newer version of nagelfar (1.3.3) 2022-10-28 13:36:35 +02:00
Xavier Delaruelle
39923ad178 Revert "init: setup zsh FPATH through autoinit command"
This reverts commit 59ac24e243.

FPATH variable cannot be handled within autoinit process as this is not
an environment variable. Thus when modulecmd.tcl is executed, it does
not know the current value of FPATH. So if it sets FPATH during
autoinit, previous value of this variable is lost. As a result FPATH
must stay defined in initialization script.
2022-10-16 14:06:11 +02:00
Xavier Delaruelle
6599131c1b install: correct arg order for date cmd on FreeBSD 2022-10-11 06:52:54 +02:00
Xavier Delaruelle
f88ba27be0 Remove testsyntax Makefile target
testsyntax Makefile target is removed. testlint testsuite has to be used
instead.
2022-09-01 06:43:38 +02:00
Xavier Delaruelle
7a41543601 ts: add lint testsuite 2022-09-01 06:43:38 +02:00
Xavier Delaruelle
7ae26a1254 install: use install rather mkdir or cp
Use install command rather mkdir or cp to apply regular file mode when
installing Modules. A specific umask configuration set in the current
environment will not impact modes set on installed files.

Follow same approach than Makefiles generated by autotools, with an
INSTALL Makefile variable.
2022-07-18 07:41:19 +02:00
Xavier Delaruelle
0e9d071fee Disable nagelfar syntaxdb/plugin usage if addons disabled 2022-07-14 22:54:00 +02:00
Xavier Delaruelle
8db4350ff7 install: add rules to deploy global rc linter plugin 2022-07-12 07:50:33 +02:00
Xavier Delaruelle
06c61c7b1b install: add --nagelfardatadir/--enable-nagelfar-addons
Add --nagelfardatadir and --enable-nagelfar-addons installation option
to control whether or not Modules-specific Nagelfar files need to be
installed and in what location.
2022-07-12 07:50:33 +02:00
Xavier Delaruelle
d40261c763 install: add --with-tcl-linter-opts configure option
Introduce the --with-tcl-linter-opts configure option to choose at
installation time the options to pass to the tcl linter program. Default
option is ''.
2022-07-12 07:50:32 +02:00
Xavier Delaruelle
111db3af55 install: add --with-tcl-linter configure option
Introduce the --with-tcl-linter configure option to choose at
installation time the default program command to use to lint
modulefiles. Default Tcl linter is 'nagelfar.tcl'.
2022-07-12 07:43:19 +02:00
Xavier Delaruelle
1411fca904 install: enclose install path refs in Makefiles 2022-06-16 18:57:30 +02:00
Xavier Delaruelle
59ac24e243 init: setup zsh FPATH through autoinit command
Add zsh FPATH setup in autoinit command instead of zsh shell
initialization script. This way all the shell setup is gathered in the
autoinit process. What is left in initialization script is the code to
properly call the autoinit process.

Fixes #462.
2022-06-16 18:57:26 +02:00
Xavier Delaruelle
8d9876ef9a init: setup shell completion through autoinit command
Add shell completion setup in autoinit command instead of shell
initialization scripts. Use this way one modulecmd.tcl internal code
instead of shell code for every shell having some completion to source
(bash, tcsh, fish).

Fixes #462.
2022-06-16 18:57:24 +02:00