Commit Graph

212 Commits

Author SHA1 Message Date
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
Xavier Delaruelle
f269dee47b init: setup MANPATH through autoinit command
Add MANPATH setup in autoinit command instead of shell initialization
scripts. Use this way one modulecmd.tcl internal code instead of shell
code for every shell requiring to setup MANPATH with Modules binaries
location (sh, bash, ksh, zsh, csh, tcsh, fish).

Fixes #462.
2022-06-16 18:57:22 +02:00
Xavier Delaruelle
0660d6fa4e init: setup PATH through autoinit command
Add PATH setup in autoinit command instead of shell initialization
scripts. Use this way one modulecmd.tcl internal code instead of shell
code for every shell requiring to setup PATH with Modules binaries
location (sh, bash, ksh, zsh, csh, tcsh, fish).

Fixes #462.
2022-06-16 18:57:19 +02:00
Xavier Delaruelle
c4f290d3d7 install: call git cmds in Makefile only if needed
Update Makefile to call git command only if the version.inc file needs
to get rebuilt (if it does not exist or if the git repository has been
updated after version.inc built).

Include version.inc file in main Makefile only if its variables have not
been just generated within Makefile flow.
2022-05-31 19:59:11 +02:00
Xavier Delaruelle
b9215747bc install: include generated config.{guess,sub} in dist
Include the lib/config.guess and lib/config.sub scripts in distribution
tarball if generated by autoreconf
2022-05-31 07:03:38 +02:00
Xavier Delaruelle
d6ff7dc130 install: no dependency to version.inc in init/Makefile
The Makefile script in the init directory does not depend on the
definitions stored in the version.inc file. So remove inclusion and
requirement definition to this version.inc file in init/Makefile.
2022-05-31 07:03:22 +02:00
Xavier Delaruelle
f8c9af8cdc install: tcl/coll.tcl should be built
Need to build tcl/coll.tcl as this part of the code need to use the
@MODULES_VERSION@ pattern.
2022-04-07 06:36:54 +02:00
Xavier Delaruelle
e45eb859a1 ts/lib: test tcl ext lib against a failed sysconf call
Add an utility library that supersedes the sysconf function from libc.
The sysconf function from this added library always returns an error
(-1). It is used for coverage test of the sysconf call made within the
Envmodules_InitStateUsergroupsObjCmd function of the Tcl extension
library.
2022-03-31 13:06:26 +02:00
Xavier Delaruelle
8466cc8b44 install/ts: test source-sh over OpenFOAM scripts 2022-02-28 07:15:57 +01:00
Xavier Delaruelle
95d3d80d3c install/ts: fetch/install Conda/Spack for source-sh tests
Add directives into Makefile to fetch and install Spack and Conda in
order to test source-sh feature against their profile scripts.
2022-02-25 14:49:39 +01:00
Xavier Delaruelle
cd4015b106 Revert work on noglob_eval_shells config option
Remove entirely the work on the noglob_eval_shells option as enclosing
in quotes the generated output of modulecmd.tcl to pass it to the eval
command is equivalent to disable the pathname expansion mechanism of
sh-kind shells.
2022-02-24 18:24:47 +01:00
Xavier Delaruelle
67b5fedad9 install: add --with-noglob-eval-shells configure opt
Introduce the --with-noglob-eval-shells configure option to choose at
installation time if the pathname expansion should be disabled or not in
the module function to evaluate shell code produced by modulecmd.tcl,
for the shells listed in option value.
2022-02-19 15:56:43 +01:00
Xavier Delaruelle
a0d1f27df5 Set a Code of conduct for Modules
Set a Code of conduct for the Modules project and its community. This
Code of conduct is based on the Contribution Covenant, version 2.1.
2021-11-06 15:12:16 +01:00
Xavier Delaruelle
20f4f5e9bf install: use newer version of icdiff (2.0.4) 2021-10-14 07:14:16 +02:00
Xavier Delaruelle
2a20c140af install: use newer version of nagelfar (1.3.2) 2021-10-14 07:14:16 +02:00
Xavier Delaruelle
05f3c9cde0 doc/install: rename 'diff_v3_v4' doc into 'changes' 2021-09-06 06:55:34 +02:00
Xavier Delaruelle
0b7f7d8e59 doc: add doc ref and links in README 2021-09-02 21:08:15 +02:00
Xavier Delaruelle
8095f11b89 Set silent_shell_debug code if option enabled on autoinit
Generate the silent_shell_debug code in module shell function during the
autoinit processing if the silent_shell_debug configuration option is
enabled.

Choice made at installation time may now be updated later on with the
silent_shell_debug configuration option. If enabled prior calling
autoinit (or enabled within initrc configuration file), the silent shell
debug code will be included in module shell function.
2021-08-31 20:48:42 +02:00
Xavier Delaruelle
4baf5dc4db Add quarantine_support configuration option
Convert the --enable-quarantine-support installation option in a
quarantine_support configuration option. When this option is enabled the
autoinit sub-command produces the module shell code with quarantine
mecahnism support. When disabled, code is generated without quarantine
support.

This way decision to have or not the quarantine mechanism code can also
be made in initrc configuration file. As a result
--enable-quarantine-support installation option new controls the default
behavior to generate or not the quarantine code, but this could now be
superseded in initrc configuration file.

Different setup cases are foreseen:
1. quarantine code has been included in module shell function, then
   quarantine_support config is disabled
   > config disablement is not effective as shell code is already set
2. quarantine code has not been included in module shell function,
   then quarantine_support config is enabled
   >  config enablement is not effective as shell code is already set
3. during module initialization, quarantine_support config is enabled in
   initrc
   > shell code generated with quarantine code
4. during module initialization, quarantine_support config is disabled
   in initrc
   > shell code generated without quarantine code
5. during module initialization, quarantine_support config is enabled by
   default or via env
   > shell code generated with quarantine code
6. during module initialization, quarantine_support config is disabled by
   default or via env
   > shell code generated with quarantine code
2021-08-26 20:13:51 +02:00
Xavier Delaruelle
32cdb149e4 install: add Makefile rules to build Gtags indexes 2021-08-23 21:59:48 +02:00
Xavier Delaruelle
7a4002ab8f install: add Makefile rule to build Ctags index 2021-08-07 13:34:53 +02:00
Xavier Delaruelle
92bd6684bb ts: check coverage of split tcl files
Update makefile rules to check coverage of split tcl source files rather
built modulecmd.tcl script.
2021-08-01 09:30:16 +02:00
Xavier Delaruelle
5d0c5eb469 install: add rules to build modulecmd.tcl from split files
modulecmd.tcl has been split in the repository in several tcl files
located in the tcl/ directory. This change has been done to make code
editing easier.

modulecmd.tcl is still shipped as a single executable script to ensure
best performances. This single script is made by joining all the tcl
files from tcl/ directory.

An alternative approach has been tested where modulecmd.tcl auto loads
the procedure located in external tcl files. But a performance overhead
was observed. So it has been decided to split code to edit sources but
still build and ship a standalone modulecmd.tcl script.
2021-07-30 10:12:20 +02:00
Xavier Delaruelle
09e9251e18 install: remove compat version-related rules 2021-07-24 14:06:09 +02:00
Xavier Delaruelle
0689bb5bb9 ts: use default conf names in example for tests 2021-07-24 14:06:06 +02:00
Xavier Delaruelle
c2ffd669d6 Look at conf files in etcdir or initdir not both
Only look at configuration files found in the location designated by the
'--etcdir' or '--initdir' option (depending on the value of
'--with-initconf-in' option). Configuration files were previously
searched in both locations.
2021-07-18 21:45:22 +02:00
Xavier Delaruelle
aaf29548bd script: remove createmodule.sh and createmodule.py
createmodule.sh and createmodule.py scripts are superseded by the
`sh-to-mod` sub-command that supports conversion from more shell
languages (ksh, zsh, fish, csh) and handles more environment changes
(alias, shell function).
2021-07-16 15:55:55 +02:00
Xavier Delaruelle
f4b69a2e9d install: add --with-variant-shortcut configure option 2021-06-28 20:44:23 +02:00
Xavier Delaruelle
db74c4cbdf install: allow building from submodule repository
Fix installation scripts to allow building Modules when its repository
is set as a git submodule.

Closes #398.
2021-05-11 20:14:07 +02:00
Xavier Delaruelle
c00ecefaa4 install: add --with-editor configure option
Introduce the --with-editor configure option to choose at installation
time the default editor command to use to interactively edit
modulefiles. Default editor is 'vi'.
2021-04-24 13:36:51 +02:00
Xavier Delaruelle
105e3234cb doc: add link to @EnvModules Twitter page in README 2021-02-28 19:25:49 +01:00
Xavier Delaruelle
c8217f7263 install: correctly clear git remote in build ref tag 2021-02-17 16:04:04 +01:00