Clarify modulefile man page and .version modulerc interpretation about
ModulesVersion variable which can only refer to modulefile located in
the same directory than where this .version modulerc file is located.
Report error if a nested ModulesVersion value is detected. This value is
ignored.
Add tests in 80-deep suite on that change.
Clarifies RH#979787 [1]
Fixes#176
[1] https://bugzilla.redhat.com/show_bug.cgi?id=979787
During a modulefile lookup in getModules, directory definitions are
updated if some empty directories are found in them.
Do not attempt this directory definition update when finding an empty
directory if parent directory has been overwritten by an alias
definition for instance.
Fixes#170
Fix getModules procedure to correctly handle virtual modules when the
sub-directories they refer to does not exist on the filesystem. For
instance 'modvirt/dir0/sub1/1.0' may be a virtual module defined with
module-virtual modvirt/dir0/sub1/1.0 .common
in 'modvirt/.modulerc' where modvirt/dir0 and modvirt/dir0/sub1 do not
correspond to existing directories on the filesystem.
Now getModules will define among its result virtual directory entries to
make the deep virtual modules findable when, for instance searching a
default version.
Add non-regression tests in 20-locate and 80-deep suites for the deep
virtual module use-case.
Algorithm were matching middle or end part of module even if no match on
root element.
Add 022-switch tests in 80-deep to test getLoadedWithClosestName on deep
module names.
Add non-regression tests in 20-locate/045-symvers,
20-locate/068-transitive and 80-deep/068-transitive to ensure that
'default' symbol has same spreading properties than other symbols.
When parsing symbolic version targets in getModules procedures, these
targets were previously included in search result only if they were
found on the filesystem (file or directory). But sometimes, these
targets may be module alias and not a consistent file or directory.
This situation happens when a module-version is set on an alias which in
turns targets a modulefile in a different directory. When you query the
symbolic version in the end-point modulefile directory, you get the
modulefile as a result, but if you query the symbol in the alias
directory, this alias will be returned.
Adapt non-regression tests in 060-rc of 20-locate suite and in
068-transitive of 80-deep suite. Improve especially the 068-transitive
tests with aliases and symbols set from different module.
Register all symbolic module version in g_moduleVersion array by letting
setModuleResolution procedure handle this array. So now module-version
procedure deleguates g_moduleVersion handling to setModuleResolution.
With this change all symbols are now registered in g_moduleVersion which
enables to search on these names during an 'avail' command. It was
previously possible to match these symbols only if they were explicitely
defined on a 'module-version' statement and were not about the 'default'
symbol. Symbols inherited by transitivity are now also registered in
g_moduleVersion and resolution structure by recursive call to
setModuleResolution procedure.
setModuleResolution procedure has also been adapted to withdraw its
'override_default' argument. When called, setModuleResolution will now
always override an already defined symbolic version, but 'module-version'
procedure will refrain from calling setModuleResolution if this symbol
is already set in g_moduleVersion.
Introduce non-regression tests 068-transitive in 20-locate and 80-deep
suites and add new tests in 060-rc in 20-locate suite to check
transitive definitions in various conditions.
When consolidating directory content information in getModules
procedure, handle empty directories so they are removed from the result
array. When an empty directory is removed and its parent directory
becomes empty after child removal, remove also this directory and so on.
Moreover when an empty directory is removed and if it was the default
version of this parent directory, default is changed to last element in
parent directory.
Add and adapt tests in 020-avail of 91-sort suite.
Add non-regression tests in 080-access of 80-deep suite to guaranty
correct behavior when some access issues happen on modulefile or
modulerc or directory in case of deep modulefiles.
Improve getPathToModule procedure to be able to solve any-kind of module
aliases within a single call rather than restarting new searches when
solved aliases are on the upper part (elt1/) of a current search
(elt1/elt2/) sharing same module root.
Add isSameModuleRoot procedure on the way to be able to check two
modules share the same base name.
Add non-regression tests in 020-load and 030-display of 80-deep suite to
guaranty that sub or upper aliases are correctly found.
Translate module name to currently interpreted module name when name
correspond to the last part this interpreted module only if translation
is enabled (was previously done in all cases). Translation is enabled
when usage of symbolic modulefile names are allowed, which means it is
enabled from 'module-version', 'module-alias' and 'module-info version'
and 'module-info symbols'.
Add non-reg tests in 020-load and 030-display of 80-deep suite to check
that.