Commit Graph

2634 Commits

Author SHA1 Message Date
Xavier Delaruelle
bb2c0960ba doc: clarify hidden module location in modulefile.4 2020-03-29 08:20:49 +02:00
Xavier Delaruelle
2273640cd5 Add ref in res to version target not in res but not searched
Enable resolution of default module in module sub-directory when this
default symbol targets an hidden directory (whose name starts with a dot
character).

Adapt getModules procedure to add reference, in the directory description
returned as result, for symbolic version targets that are hidden, not
included in returned result but excluded from search made.

Fixes #331
2020-03-29 08:20:49 +02:00
Xavier Delaruelle
e9bd27d928 Filter hidden sym/alias/module from aliases output
Filter-out from the output of the `aliases` sub-command all hidden
aliases, symbolic versions or hidden modules targeted by a non-hidden
symbolic version.

Fixes #330
2020-03-29 08:20:16 +02:00
Xavier Delaruelle
d8a58feeeb ts: test alias/symver/virtual hidden modules in 20/067 2020-03-29 08:20:16 +02:00
Xavier Delaruelle
dac7d33abb Consider alias/symver/virtual hidden if name starts with .
Hide special modules (aliases, symbolic versions and virtual modules)
whose version name starts with a dot character (.) from avail, whatis
and paths searches if their query does not fully match special module
name.

Hidden symbolic version will still be reported if the modulefile it
targets is part of search result.

Fixes #329
2020-03-29 08:19:58 +02:00
Xavier Delaruelle
e0954a265b ts: add 80/090 deep alias and virtual module tests 2020-03-29 08:19:57 +02:00
Xavier Delaruelle
949234abfa ts: compare sorted json output
As json output is not sorted by modulecmd.tcl it may happens that test
output found on some configurations or platforms is not the one
expected although it is correct.

To avoid these errors a new test procedure is added to compare stderr
output in a sorted manner, so error will be obtained if something is
missing in the result but not if the result is outputed in a different
order.
2020-03-29 08:19:57 +02:00
Xavier Delaruelle
c8cca76aa2 Exclude directory from findModules result
There is no need to record found directory in findModules result as
these elements will be computed in getModules.
2020-03-29 08:19:57 +02:00
Xavier Delaruelle
e1996b6535 No record of dir content in res returned by findModules
No need to record the content of each directory in the result returned
by the findModules procedure as full directory content (with virtual
elements) is computed in getModules.
2020-03-29 08:19:57 +02:00
Xavier Delaruelle
e53978b6fe Remove useless modMatchAtDepth procedure
Following getModules code refactoring, the generated procedure
modMatchAtDepth has become useless. Only doesModMatchAtDepth is now
used.
2020-03-29 08:19:57 +02:00
Xavier Delaruelle
d778d15652 ts: adapt tests to getModules refactoring
Available modules search process is not changed but the refactoring of
the getModules procedure fixed some hidden issues like in 80/068: symbol
targeting a directory which contains aliases where not correctly
analyzed previously (aliases where skipped from result)

Module avail result order also change when JSON format output is enabled
due to this code refactoring (as JSON output is not sorted).

It also fix non-wild searches (performed during whatis or paths
sub-commands) that previously matched partial alias, symbolic version or
virtual module names. Fully matching names for these kind of modules are
not only retained for these non-wild searches. Test results in 70/190,
70/240 and 70/290 have been adapted.
2020-03-29 08:19:57 +02:00
Xavier Delaruelle
4885457891 Refactor getModules procedure
Rework the full getModules procedure to simplify its processing and
apply the same match tests to every kind of modules (regular modulefile,
symbolic, version, alias or virtual module).

getModules procedure acts now in 4 phases. First every kind of modules
are gathered. Then a second phase is set to filter-out modules
dynamically hidden or forbidden (this filter will be deployed later on).
Third phase is the elaboration of each directory content to determine
especially their default and latest versions. At last the fourth phase
process all gathered results to only keep those matching search query.

As the procedure now applies the same mechanisms for all kind of
modules, this code refactoring has solved several issues:

* An `avail` search over a symbolic version targeting a directory now
  correctly returns the special modules (alias and virtual module) lying
  in this directory.

* `whatis` and `paths` searches only return special modules (symbolic
  version, alias and virtual modules) that fully match search query not
  those that partially match it.

* alias and virtual module whose name mention a directory that does not
  exists are correctly handled.

Fixes #168, #327 and #328
2020-03-29 08:19:43 +02:00
Xavier Delaruelle
dddc4789c1 doc: update deflatest design for default/latest modfile 2020-03-26 12:19:25 +01:00
Xavier Delaruelle
01ee25d935 doc: desc. ml bash comp/fish stderr fix/space fixes in NEWS 2020-03-21 09:32:45 +01:00
Xavier Delaruelle
15158c3323 Fix path cmd result if it contains space char 2020-03-19 20:55:56 +01:00
Xavier Delaruelle
b74134df3c ts: adapt tests after enclosed mod names in adv_vers_spec disabled mode 2020-03-19 13:42:29 +01:00
Xavier Delaruelle
833a68fc5f Enclose names incl. space even if adv_vers_spec is disabled
Enclose module name and versions if it contains a space character even
if the advanced versio specifier mechanism is disabled.

Rework the advanced version specifier parsing done in
parseModuleVersionSpecifier procedure to also check argument passed if
advanced_version_spec mechanism is disabled and enclose them in curly
braces if a space character is found in them.
2020-03-19 13:42:29 +01:00
Xavier Delaruelle
650ca9881d ts: tests module path/name/version finishing by a space char 2020-03-19 13:42:29 +01:00
Xavier Delaruelle
964dd5baf8 ts: add tests mixing adv vers spec and deps 2020-03-19 13:42:29 +01:00
Xavier Delaruelle
95126a8fcd ts: skip wspace tests if symlinks not supported on fs 2020-03-19 13:42:29 +01:00
Xavier Delaruelle
6c1145a68c Correctly enclose mod name when defining cmp proc 2020-03-19 13:42:29 +01:00
Xavier Delaruelle
213704bed7 Keep mod vers spec enclosed if containing space when parsed 2020-03-19 13:42:29 +01:00
Xavier Delaruelle
edb50d5a94 ts: test space in names with icase/extdfl/adv_vers_spec 2020-03-19 13:42:29 +01:00
Xavier Delaruelle
3d249ddd27 ts: add names with space in test example initrc 2020-03-19 13:42:29 +01:00
Xavier Delaruelle
119ecb1704 ts: test name containing space on install ts 2020-03-19 13:42:29 +01:00
Xavier Delaruelle
bfbf448c9f appveyor: use default inst dir for win native test 2020-03-19 05:30:19 +01:00
Xavier Delaruelle
caf560668f ts: check availability of createmodule.py in install ts 2020-03-19 05:30:19 +01:00
Xavier Delaruelle
89814e1a1d ts: test space in name against no-indepth and no implicit_default 2020-03-19 05:30:19 +01:00
Xavier Delaruelle
ffe812cecd Enclose mod and modpath names if space in them when saving coll 2020-03-19 05:30:19 +01:00
Xavier Delaruelle
637f6a19a0 Fix collection parsing to handle enclosed names
Correctly read modulepath and module names if enclosed in double-quotes
or curly-braces to escape space characters used in these names.
2020-03-19 05:30:19 +01:00
Xavier Delaruelle
a6cb073970 ts: test colls with space in modulepath and module names 2020-03-19 05:30:19 +01:00
Xavier Delaruelle
acc3ab8f32 ts: test space in module name against ml command 2020-03-19 05:30:19 +01:00
Xavier Delaruelle
9571f590eb ts: tests using space in module dependencies 2020-03-19 05:30:19 +01:00
Xavier Delaruelle
4a7c296c1c Fix handling of mod containing space when set as deps
Fix dependency analysis mechanisms to correctly handle modulefiles
contaning space in their name.
2020-03-19 05:30:19 +01:00
Xavier Delaruelle
d5eacbe2e0 ts: tests using space in module or modulepath names 2020-03-19 05:30:19 +01:00
Xavier Delaruelle
342c07c568 Protect mod or modpath names containing space from eval
Correctly handle modulefiles and modulepaths containing a space
character in their name.

Protect module and modulepath names which contain a space from being
splitted in two words.
2020-03-19 05:30:19 +01:00
Xavier Delaruelle
711c90104f Update stderr redirection for new Fish shell versions
Use of '^' character to redirect stderr has been deprecated starting
Fish version 3.1. It now produces an error. Stderr should be redirected
with '2>' like on SH shells. Hopefully '2>' redirection is also
supported on old Fish versions (all version 2 support it).

Fixes #325
2020-03-19 05:29:08 +01:00
Xavier Delaruelle
05451a831f init: define ml completion only if ml command defined 2020-03-14 10:41:03 +01:00
Adrien Cotte
f16c0d8a0f init: add 'ml' command support in bash completion 2020-03-14 10:41:03 +01:00
Xavier Delaruelle
c0388ffbeb doc: desc. recent changes in NEWS 2020-03-11 05:34:33 +01:00
Xavier Delaruelle
dcd6025503 install/ts/doc: install and test envml.cmd along other *.cmd 2020-03-10 07:44:20 +01:00
Xavier Delaruelle
d787bc14ac script: apply same module enablement check in all *.cmd 2020-03-10 07:44:20 +01:00
Jacques Raphanel
ae235a87ad script: introduce envml.cmd for windows
Provide a dedicated batch file to provide similar behavior of envml bash
script but for CMD Windows shell. Update existing envml bash script to
provide same behavior for cmd and sh file (split argument over ';'
character, in addition to '&' character).
2020-03-10 07:44:20 +01:00
Xavier Delaruelle
6d3a27b786 doc: add ref to 4.0 closed issues in diff doc 2020-03-09 08:19:50 +01:00
Xavier Delaruelle
0d13104565 doc: desc. error stack trace in MIGRATING 2020-03-09 06:45:45 +01:00
Xavier Delaruelle
88ea9b5ad0 github: add issue templates 2020-03-08 20:33:10 +01:00
Xavier Delaruelle
99853361b1 ts: add more error stack tests 2020-03-08 10:09:32 +01:00
Xavier Delaruelle
36aa2e17e5 ts: tclsh is reported tclshX.Y on FreeBSD 2020-03-08 10:09:32 +01:00
Xavier Delaruelle
02fb2e5529 ts: adapt err stack output for siteconfig failed eval 2020-03-08 10:09:32 +01:00
Xavier Delaruelle
65c9f1f19f Rework error stack filtering for siteconfig eval issue
When a error occurs during the evaluation of the siteconfig specific
file, only remove from error stack the elements relative to the
modulecmd.tcl code that evaluates the file.
2020-03-08 10:09:32 +01:00