Commit Graph

146 Commits

Author SHA1 Message Date
Xavier Delaruelle
62334ed0f7 Improve new {append,prepend,remove}-path commands
Refactor code to call from the module command line modulefile-specific
commands. These commands can only be called from the command line, not
when calling 'module' procedure from a modulefile, to avoid any
ambiguity.

When parsing command line arguments, check context to know if '-d' means
'--default' (avail command) or '--delim' (*-path commands).

Add the new commands to the existing shell completion scripts (bash,
tcsh, fish, zsh).

Document new commands in the module.1 man page.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-11-26 10:40:29 +01:00
Xavier Delaruelle
eafd2c89a8 doc: desc MODULES_SILENT_SHELL_DEBUG in module.1 and NEWS 2017-11-15 08:23:40 +01:00
Xavier Delaruelle
062570c3c7 doc: reorder env var in module.1 2017-11-13 06:01:50 +01:00
Xavier Delaruelle
bc04fe0dd1 doc: describe quar-related variables in module.1 2017-11-13 05:56:25 +01:00
Xavier Delaruelle
b7e474ca89 Fix no branch name for version release on RTD builds 2017-11-01 17:13:51 +01:00
Xavier Delaruelle
3c77ba2760 Correct version release tag in Makefile and Sphinx 2017-11-01 15:35:30 +01:00
Xavier Delaruelle
d8887d345f Introduce pager support
Paginate stderr output into paging command, using 'less' by default,
following the same fashion and behavior than 'git' command.

Pager is enabled by default in modulecmd script. New global variables
'g_use_pager', 'g_pager' and 'g_pager_opts' control default behavior of
module command.

Pager is enabled only if stderr stream is attached to a terminal.

Pager setup can then be superseeded by environment variables. If LESS
variable is set and paging command is set to 'less', default pager
options are cleared to use those defined in LESS variable.

If MODULES_PAGER variable is defined, its value superseeds paging
activation, command and options. If this variable is empty, paging is
disabled.

If PAGER variable is defined and MODULES_PAGER is unset, PAGER value
superseeds paging activation, command and options. If this variable is
empty, paging is disabled.

Default behavior and MODULES_PAGER or PAGER environment variables can be
superseeded by command-line options: --paginate to enable paging and
--no-pager to disable it.

When pager is enabled, a pipe file descripted is ignited to the paging
command and option for stderr stream. Once set, this file descriptor is
used by all report procedures to output message content, rather using
stderr.

modulecmd command-line parse has been revised not to output message
during argument treatment. Debug, warning and error messages are saved
to then be displayed once pager setup is achieved.

An 'initPager' procedure is introduced to configure then start paging.
A 'cleanupAndExit' is added to close pager before exiting if pager has
been started.
2017-10-28 15:53:27 +02:00
Xavier Delaruelle
a7dbbf2ad9 doc: add intro and refine toc of index page 2017-10-15 21:28:37 +02:00
Xavier Delaruelle
29f9afe7c6 doc: migrate NEWS doc from TXT to RST 2017-10-14 09:40:29 +02:00
Xavier Delaruelle
897084023f doc: migrate INSTALL doc from TXT to RST 2017-10-14 09:29:42 +02:00
Xavier Delaruelle
2f6bf21b77 doc: migrate MIGRATING doc from MD to RST
To integrate it into sphinx process and make it available on the Web.
2017-10-14 09:29:42 +02:00
Xavier Delaruelle
67b40c920f doc: define sphinx required minimal version in conf 2017-10-13 22:00:34 +02:00
Xavier Delaruelle
95043aafae doc: detail path variable elt counter in man-pages 2017-10-10 08:11:14 +02:00
Xavier Delaruelle
5d15d242b5 doc: mention output redirection in migrate and diff 2017-10-10 06:56:36 +02:00
Xavier Delaruelle
7d93c42f32 install: use rm rather sphinx to clean built docs 2017-10-09 07:16:48 +02:00
Xavier Delaruelle
f913532caf doc: add FAQ imported from SF wiki 2017-10-07 19:19:33 +02:00
Xavier Delaruelle
7de4c10bcc install: use sed rather perl for substitutions
Use sed instead of perl in configure and Makefile scripts as perl is not
required anymore to build documentation. sed is a lighter requirement to
build and install software.
2017-10-07 17:57:08 +02:00
Xavier Delaruelle
0afa66b5a4 install: no mention of master git branch in vers num 2017-10-07 16:33:36 +02:00
Xavier Delaruelle
e80f170de8 install: broader usage of makefile translate-in-script 2017-10-07 16:15:52 +02:00
Xavier Delaruelle
b1dc5ea1e2 install: rm doc BUILD_DIR if exists only 2017-10-07 16:13:50 +02:00
Xavier Delaruelle
eb5849ec92 install: adapt doc build process to sphinx
Change makefile to build doc with sphinx rather pod. Docs are now
pregenerated in dist-tarball, to avoid requiring documentation build
tool when installing from these dist-tarball.

Adapt travis conf & RPM spec file to the new documentation build
process.
2017-10-07 15:11:19 +02:00
Xavier Delaruelle
42044724dd doc: introduce sphinx configuration
To build existing manpages and diff_v3_v4 document.
2017-10-07 15:11:19 +02:00
Xavier Delaruelle
941cfb2b3f doc: migrate from pod to rst
Transform source documents from POD format to reStructuredText to then
benefit from Sphinx documentation framework and Read The Docs publishing
capabilities.
2017-10-07 15:10:22 +02:00
Xavier Delaruelle
af3e6401da install: set manpage date to modules build date 2017-09-30 22:03:37 +02:00
Xavier Delaruelle
762eb282c0 install: make doc only install man and txt
No install of HTML files, so no need to build them at make install.
2017-09-30 21:56:28 +02:00
Xavier Delaruelle
429215f9b7 install: handle version number through git tags
Introduce a version.inc file sourced by Makefiles, that holds release
number and build information. Makefiles use these information to set
correct version number in manpages and modulecmd.tcl script.

version.inc is present in dist tarball. This file is generated from
version.inc.in file by main Makefile when working in git repository.

Release information are retrieved from the tags of the git repository.
Release number corresponds to last git tag set. Build number is the
result of the 'git describe' command: this information helps to know
from what git branch and commit the current build is made of.
2017-09-30 21:47:26 +02:00
Xavier Delaruelle
ce1da74cf4 doc: add EXIT STATUS section in module.1 2017-09-29 08:00:43 +02:00
Xavier Delaruelle
3cc6984fea doc: describe modulefiles hiding feature
In MIGRATING guide and diff reference doc.
2017-09-29 07:11:49 +02:00
Xavier Delaruelle
06693a77e3 doc: avail/apropos/whatis support glob patterns 2017-09-27 06:18:22 +02:00
Xavier Delaruelle
d2ed5dc59e doc: clarify submod unload during switch command 2017-09-27 06:03:33 +02:00
Xavier Delaruelle
8ec675c299 Release of version 4.0.0-beta
Adapt testsuite to take new release name in account.
2017-09-25 18:23:48 +02:00
Xavier Delaruelle
2a430cdd8c doc: rename diff_with_c-version to diff_v3_v4 2017-09-25 18:23:48 +02:00
Xavier Delaruelle
065353ed19 doc: improve diff doc with more changes between 3.2 & 4 2017-09-22 21:48:17 +02:00
Xavier Delaruelle
93cde2ef61 doc: rephrase diff to talk about Modules 3.2 and 4 2017-09-22 21:32:38 +02:00
Xavier Delaruelle
e67cc001b1 doc: describe MODULES_USE_COMPAT_VERSION in module.1 2017-09-22 21:32:38 +02:00
Xavier Delaruelle
ad3ad5c98d Rename Modules-Tcl > Modules in docs and install scripts 2017-09-15 06:15:07 +02:00
Xavier Delaruelle
1cdae156ff install: --enable-compat-version to build compat vers
Introduce '--enable-compat-version' configure argument to configure and
build compatibility (C) version in addition to main version.

This compatibility version is located in the 'compat' directory, which
is automatically populated with 'c-master' git branch if we work in the
git repository.

'configure' script is adapted to run the compatibility version relative
configure script. Unknown command-line arguments are passed down to this
script, which raise error if these arguments are not known there either.
Some compatibility version configure script argument are also
incompatible in this dual installation mode, so an error is raised
(--enable-versioning for instance).

Build process will generate and install modulecmd-compat, module-compat.1
and modulefile-compat.4 from this compatibility version. 'compat' suffix
enables clear distinction with main version files.

Acknowledgment: this development has been made and funded within the
framework of the PRACE Fifth Implementation Phase (PRACE-5IP) project
(http://www.prace-ri.eu/). PRACE-5IP receives funding from the EU's
Horizon 2020 research and innovation programme (2014-2020) under grant
agreement no. 730913.
2017-09-13 06:12:49 +02:00
Xavier Delaruelle
9006a3baab install: avoid make to rebuild Makefile.inc 2017-09-03 15:56:08 +02:00
Xavier Delaruelle
cc4fe8f959 Add support for hidden 'dot' modulefiles
Modulefiles with part of their name starting with a '.' dot character
are considered as hidden modulefiles, like dot files on Unix-kind
filesystems. After introduction of the getModules/findModules procedures
hidden modulefiles where automatically discarded. So this commit
re-introduce the support to locate these dot modulefiles.

Add a 'fetch_hidden' argument to the findModules procedure to enable an
extra lookup on walked directories to gather the dot modulefiles. The
getModules procedures now looks at the passed mod and if named module
correspond to a dot modulefile findModules 'fetch_hidden' argument is
turned on. Since getPathToModule call to getModules for broad search
(with just passed mod root name), this procedure also makes the
'is hidden module' test to order getModules to do the hidden search.

A hidden modulefile does not appear in case of wild search, it is only
returned when search is about its exact name. When a symbolic version
targets a hidden modulefile, this modulefile will also be returned in
case search is about symbol exact name. A module alias targeting a
hidden modulefile is returned as any other aliases.

Add 067-hidden non-regression tests in 20-locate suite.
2017-09-03 15:54:57 +02:00
Xavier Delaruelle
d81c995b37 Handle alias/sym pt. to another path in getPathToModule
When searching for a module in a given modulepath directory, if a module
alias or a symbolic version matches searched module but the target of
this alias or symbol is not found in current modulepath directory,
search for this target restarting search from the first modulepath in
list to ensure modulepath priority.

Previously this kind of alias or symbol targeting a module in a
different modulepath were only found if this path was set after the
modulepath where the alias or symbol is defined.

Clarify alias and symbolic version modulepath resolution steps in
modulefile man page.
2017-09-03 15:54:00 +02:00
Xavier Delaruelle
ec0f3eb2e2 More standard shebang for modulecmd.tcl
Make use of './configure' information to set a precise tclsh shebang on
modulecmd.tcl script. This change requires to move modulecmd.tcl to
modulecmd.tcl.in within repository.

Shebang is set to '@TCLSHDIR@/tclsh' rather just '@TCLSH@' in
modulecmd.tcl.in to help forge code determines that this file is a Tcl
script.
2017-08-17 19:47:35 +02:00
Xavier Delaruelle
b6d4404153 install: fix Makefile generation flaws
Generate a shared 'Makefile.inc' file rather all 'Makefile's at
configure time. Avoid init/Makefile being rebuilt by initscript '%.in'
rules.

Correct 'all' rule typo in doc/Makefile.

Enforce '.modulespath' symlink creation when usecverdotmodulespath is
enabled.
2017-08-11 23:13:05 +02:00
Xavier Delaruelle
a625d685da Support for R "shell"
And adapt documentation, installation and testsuite.
2017-08-09 15:32:45 +02:00
Xavier Delaruelle
6ce8fda40a Support for Ruby "shell"
And adapt documentation, installation and testsuite.
2017-08-09 00:19:31 +02:00
Xavier Delaruelle
e5aa815663 Use file extension for perl/python init script
Rename 'perl' in 'perl.pm' and 'python' into 'python.py' to get same
init script filename than C-version.
2017-08-08 18:21:11 +02:00
Xavier Delaruelle
1d5232c55c Support for CMake "shell"
And adapt documentation, installation and testsuite.
2017-08-07 16:11:55 +02:00
Xavier Delaruelle
14ddb70b37 doc: clarify 'set-alias' command 2017-07-25 20:53:58 +02:00
Xavier Delaruelle
61139899c2 Keep 'module load' lines after init{rm,clear}
Instead of removing the whole line when no more module specified on it
during an 'initrm' command or during an 'initclear', keep the line with
'module load' to be able to reuse this line on next 'initadd' command.

Adapt non-regression tests in 050-rm and 060-2nd of 60-initx suite and
diff doc.
2017-07-24 19:55:41 +02:00
Xavier Delaruelle
634829606f Warning rather error on C-version specific switches
Report an 'unsupported option' warning message when C-version specific
command-line switches are passed rather than producing an 'invalid
option' error.

Adapt non-regression tests of 00-init/090-switches and
70-maint/060-apropos and diff doc.
2017-07-24 16:20:30 +02:00
Xavier Delaruelle
193ca541fe Relax constraint on cmd line args position
Look the full argument list to find options or command switches, so
options may be passed after the command name and command switches may be
found before the command name. With this behavior commad-line argument
position constraint is aligned with C-version.

Adapt non-regression tests in 70-maint suite and diff doc.
2017-07-24 10:33:19 +02:00