Commit Graph

82 Commits

Author SHA1 Message Date
Xavier Delaruelle
7d61eace20 init: always set code for silent_shell_debug code
Update initialization scripts to make the code for the
silent_shell_debug mechanism always defined there.
2021-08-31 07:22:01 +02:00
Xavier Delaruelle
57c04bbc8f init: add quarantine_support config to completion script 2021-08-26 20:14:06 +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
d3e066aa01 init: set modulepaths only in modulespath if installed
When the installation option `--enable-modulespath` is set, the list of
modulepath to enable by default is now only defined in the `modulespath`
configuration file and not anymore in the `initrc` configuration file.
2021-08-17 20:12:31 +02:00
Xavier Delaruelle
e48e8a45d4 install: use bash shell to translate init scripts
Set init Makefile to use bash as shell to correctly expand the $''
syntax used in translate-in-script.
2021-08-16 07:05:35 +02:00
Xavier Delaruelle
09e9251e18 install: remove compat version-related rules 2021-07-24 14:06:09 +02:00
Xavier Delaruelle
0f76f1f13b init: name default config files initrc/modulespath
Rename the configuration template files following the new default naming
scheme for these files: modulerc becomes initrc and .modulespath becomes
modulespath.
2021-07-24 14:06:06 +02:00
Xavier Delaruelle
664808acd7 install: swap --enable-dotmodulespath/--enable-modulespath
Make --enable-modulespath the primary option name and
--enable-dotmodulespath the secondary option name as .modulespath is not
anymore the primary name of this configuration file.
2021-07-18 22:06:02 +02:00
Xavier Delaruelle
e11acd3fcb init: add try-load sub-cmd to completion scripts 2021-06-30 21:54:06 +02:00
Xavier Delaruelle
09aec34876 init: add edit sub-cmd to completion scripts 2021-06-30 21:48:49 +02:00
Xavier Delaruelle
20a7015a41 init: add variant_shortcut config to completion script 2021-06-28 20:44:23 +02:00
Xavier Delaruelle
95296fd75e init: add editor config to completion script 2021-04-24 13:36:51 +02:00
Anais GAERTNER
36b32fc24f init: add -w/--width options to completion scripts 2021-02-18 09:45:58 +01:00
Anais GAERTNER
e3548dc5d7 init: add term_width config to completion script 2021-02-18 09:45:58 +01:00
Xavier Delaruelle
b41655eb30 install: silently include version.inc in Makefiles
Silently include version.inc in main, doc and init Makefiles to avoid
'Makefile:349: version.inc: No such file or directory' warning message
when version.inc needs to be rebuilt prior being loaded.
2021-02-17 16:04:04 +01:00
Xavier Delaruelle
7518083803 install: no include of version.inc for 'clean' make goals 2021-02-17 16:04:04 +01:00
Xavier Delaruelle
d3b45ff648 install: build ../version.inc from init/doc Makefiles
Add makefile rule to build ../version.inc file if missing from the init
and doc Makefiles.
2021-02-17 16:04:04 +01:00
Xavier Delaruelle
94df593f4a install: pretty print on makefile build targets
Print generated file names rather commands executed to generate these
files on makefile build targets. Output when making Modules is this way
simplified. When option `V=1` is passed to make verbose mode is enabled
and executed commands are shown.

Simplified make output does not apply to the install, uninstall, test,
clean, distclean targets and their relatives.
2021-02-17 16:04:03 +01:00
Xavier Delaruelle
5115e42fad init: add completion of -a/--all opt on list sub-cmd 2021-02-09 06:29:48 +01:00
Xavier Delaruelle
b885eb2c4c init: add -o/--output options to completion scripts 2021-02-09 06:26:09 +01:00
Xavier Delaruelle
dba0bb2f0c init: add {avail,list}_*output configs to completion scripts 2021-02-08 07:17:37 +01:00
Colin Marquardt
d6ae38c91c init: replace completion helper vars with their content
This is done for tcsh and bash where those variables clutter the
environment.

Closes #382
2021-02-04 07:04:45 +01:00
Xavier Delaruelle
37b46a3778 init: use 'sed -r' if 'sed -E' not supported
`-E` option is a *relatively* recent option of GNU sed (v4.2), yet
mandatory for OS portability (as detailled in b68e44e).

Adapt configure step to detect if sed option `-E` is supported and
fallback to `-r` otherwise.

Fixes #317
2020-02-22 13:04:04 +01:00
Xavier Delaruelle
089a680263 install: add dist-win rule to build win-specific dist zip ball 2020-01-17 21:39:22 +01:00
Xavier Delaruelle
2d64c275f6 init: move windows/moduleinit.cmd as init/cmd.cmd file 2020-01-14 06:13:30 +01:00
Xavier Delaruelle
4919ae356e init: ensure ml is defined in bash/ksh subshells 2020-01-09 20:38:50 +01:00
Xavier Delaruelle
1365a88cd4 install: add --with-initconf-in configure opt
Introduce the ability to install the Modules initialization
configuration files in the ``etcdir`` rather than in the ``initdir``. A
new configure option is introduced for this task:
``--with-initconf-in``. Accepted values for this option are: ``etcdir``
or ``initdir`` (default).
2019-07-10 13:44:48 +02:00
Xavier Delaruelle
8fa93a271d install: add --enable-quarantine-support configure opt
Add the ability to control whether or not code to support quarantine
mechanism should be added to the module function and initialization
scripts. Enabled by default

Fixes #167
2018-09-05 06:02:43 +02:00
Xavier Delaruelle
f700e055d4 install: add --enable-silent-shell-debug-support configure opt
Add the ability to control whether or not code to support silent shell
debug should be added to the module function and sh-kind initialization
scripts. Enabled by default

Fixes #166
2018-09-03 07:43:50 +02:00
Xavier Delaruelle
9df232de14 install: add --enable-append-{bin,man}path configure opts
Add the ability to append rather prepend the man or bin directory when
adding these directory to the relative environment variable is enabled
(with --enable-set-manpath or --enable-set-binpath).

Takes the form of 2 new configure options: --enable-append-manpath and
--enable-append-binpath. No effect if set but relative
--enable-set-{bin,man}path option is unset or disabled.
2018-05-03 07:09:11 +02:00
Xavier Delaruelle
13c169a27c install: workaround Linux+Make 3.81 '\\\n' issue
Was affecting tests on Ubuntu Trusty
2018-02-14 08:18:22 +01:00
Xavier Delaruelle
bec3f92304 install: more portable \n to build init/modulerc
That also works on OS X.
2018-02-13 07:52:25 +01:00
Xavier Delaruelle
5ce6488909 install: portable newline echo in Makefile 2018-02-01 20:11:16 +01:00
Xavier Delaruelle
0e9aa2b774 install: check rmdir '--ignore-fail-on-non-empty' exists 2018-02-01 19:46:34 +01:00
Xavier Delaruelle
300910d93e install: fix multi modulepath build in init/modulerc 2018-02-01 18:53:25 +01:00
Xavier Delaruelle
0c2d588293 install: define a portable \n to build init/modulerc 2018-02-01 18:53:25 +01:00
Xavier Delaruelle
170d88b5d9 install/init: use MANPATH if manpath cmd not there 2018-02-01 18:53:25 +01:00
Xavier Delaruelle
806aa278e0 install: portable symlink copy with '-R -P'
Make symlink copy portable with 'cp -R -P' (to support SunOS)
2018-01-25 06:22:14 +01:00
Xavier Delaruelle
b91637c03a install: 'cp --remove-destination' is not portable
Adapt 'cp --remove-destination' into rm + cp commands as the
--remove-destination is not understood everywhere (not known on SunOS
for instance).
2018-01-25 05:48:41 +01:00
Xavier Delaruelle
745803c57f install: get 'ps' and 'basename' loc in configure
Check paths in configure script to detect the location of the 'ps' and
'basename' commands. Then use this found location in profile.sh scripts.

First part of #147 is solved here.
2018-01-24 07:47:13 +01:00
Xavier Delaruelle
2441251ef1 install: add @VERSION@ pattern
Introduce the '@VERSION@' pattern, combination of Modules release and
build information, for building files to install.

Still rely on @MODULES_RELEASE@ and @MODULES_BUILD@ when these
information are needed prior to ./configure call (dist-related stuff) or
are expected to change after ./configure call (modulecmd.tcl in
dev environment).
2017-12-29 18:55:35 +01:00
Xavier Delaruelle
6b81b8a185 install: adapt default modpath if versioning set
If --enable-versioning configure option is set, default modulepath option
is changed  from '$prefix/modulefiles' to
'$baseprefix/$MODULE_VERSION/modulefiles'.

Adapt installation process to handle modulepath containing special '$'
character. Adapt also install testsuite to correctly check these
modulepaths containing variable references.
2017-12-28 21:42:25 +01:00
Xavier Delaruelle
dbd86817c7 install: deploy MODULE_VERSION and version modfile
When --enable-versioning is set at configure time, deploy the setup of
the MODULE_VERSION and MODULE_VERSION_STACK environment variables in
modulecmd.tcl and in a version-specific modulefile.

This version-specific modulefile is deployed in a @baseprefix@/versions
modulepath directory, which is also created specifically for versioning
installation mode.

MODULE_VERSION and MODULE_VERSION_STACK environment variables setup in
modulecmd.tcl is commented if versioning installation mode is not
enabled rather deleted to guaranty consistency across code coverage
tests (same code line numbering whatever the installation options set).

version-specific modulefile is a bit different than the one used before
<4.0 as now module version is initialized when loading this module by
calling the autoinit action on the modulecmd.tcl script.

These version-specific modulefiles enable to switch from one module
version to another but there is an incompatibility of initialization
between Modules 3.2 and Modules >=4. Switching from Modules 3.2 to
Modules >4 will be possible, but not going back from >4 to version 3.2.
2017-12-28 21:42:25 +01:00
Xavier Delaruelle
b9fe7bbb17 testsuite/travis: fix testconfig removal of etcdir 2017-12-24 12:18:02 +01:00
Xavier Delaruelle
a7993020ab testsuite/travis: add an example siteconfig.tcl
Add 'install-testsiteconfig' make target to setup a dummy siteconfig.tcl
file in install_etcdir. Link that to some of the travis checks to run
testsuite with an existing siteconfig.tcl
2017-12-23 18:22:20 +01:00
Xavier Delaruelle
353b9d662c Introduce @etcdir@/siteconfig.tcl script
Add the possibility to setup a site-specific configuration Tcl script
which will be sourced at the start of modulecmd.tcl. This site-specific
Tcl script enables to supersede global variable and procedure definition
made in modulecmd.tcl. This way local adaptations can be made without
editing the modulecmd.tcl script.

'--etcdir' configure option is added to specify the location of the
site-specific configuration script.
2017-12-23 18:22:20 +01:00
Xavier Delaruelle
a3ada7c7cd @prefix@/etc/rc does not depend on MODULESHOME anymore
Avoid dependency to the MODULESHOME environment variable when looking
for the etc/rc global RC file. To define an environment dynamic global RC
file the MODULERCFILE variable may be used. By not relying on an
environment variable we ensure this etc/rc will always be read, if it
exists, whatever the current environment state.

Location of this etc/rc is based on @prefix@ defined at configure time
which is also the basis for the MODULESHOME value, so this change should
not have an impact if MODULESHOME variable were not manipulated
afterward.

This change is useful when using module through commands resetting the
environment like 'sudo' (see RH#1443124, RH#1139165 [1])

module.1 man page is already mentionning @prefix@/etc/rc, no change
needed there.

Adapt testsuite to provide a way to test the use of a @prefix@/etc/rc
file for the whole 'make test' duration, with 'make install-testetcrc'.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1139165
2017-12-13 07:32:51 +01:00
Xavier Delaruelle
d918ee6d86 install: add --with-quarantine-vars
Add --with-quarantine-vars configure option to define quarantine
mechanism configuration at build time.

Value passed to the configure option will be used by Makefile to
initialize in the various initialization scripts the
MODULES_RUN_QUARANTINE variable and eventual MODULES_RUNENV_<VAR>.
2017-11-12 16:56:40 +01:00
Xavier Delaruelle
29fb374116 install: fix use of ifeq/wildcard in Makefile
Prefer 'rmdir --ignore-fail-on-non-empty' which is evaluated at runtime.
ifeq is evaluated at Makefile read.
2017-11-01 17:42:52 +01:00
Xavier Delaruelle
1416a523cd testsuite/travis: rework tests with ex. init config
Use make for test config setup rather direct commands in travis
configuration.
2017-10-25 16:29:04 +02:00