Commit Graph

17 Commits

Author SHA1 Message Date
Xavier Delaruelle
82ec191dc2 ts: adapt tests for #294 and #295 fixes 2019-09-20 21:12:58 +02:00
Xavier Delaruelle
00518d7171 ModulesVersion can only refer to modfile in same dir
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
2018-08-20 08:11:13 +02:00
Xavier Delaruelle
2ac81a46e9 If subdir is empty do not update parent dir if overwritten
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
2018-05-24 06:39:53 +02:00
Xavier Delaruelle
6ac49b27ad Correctly handle deep virtual modules
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.
2018-01-14 10:39:32 +01:00
Xavier Delaruelle
807689892e Fix getLoadedWithClosestName search
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.
2017-08-24 14:59:20 +02:00
Xavier Delaruelle
6f46cbf140 testsuite: check 'default' symbol spread
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.
2017-08-24 14:54:45 +02:00
Xavier Delaruelle
96d8ef97a5 Include all kind of symvers target in getModules res
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.
2017-08-17 17:08:11 +02:00
Xavier Delaruelle
06f79c50fd Let setModuleResolution handle g_moduleVersion
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.
2017-08-17 17:07:43 +02:00
Xavier Delaruelle
67352f374c Handle empty dir in getModules dir consolidation
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.
2017-07-08 14:46:30 +02:00
Xavier Delaruelle
7b53be5030 Add access issue non-reg tests in 80-deep 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.
2017-04-25 06:38:45 +02:00
Xavier Delaruelle
51b8f3e933 Non-reg tests for symbol on deep modules
Add non-regression tests in 80-deep suite to ensure correct behavior of
module-version symbols on deep modulefiles.
2017-04-17 15:16:14 +02:00
Xavier Delaruelle
2304331122 Optimize getPathToModule when solved alias is upper-mod
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.
2017-04-17 15:16:14 +02:00
Xavier Delaruelle
aa582da899 Fix getModuleNameVersion to translate mod name on demand only
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.
2017-04-17 15:13:48 +02:00
Kent Mein
bd4a515a7d Moved things out of the tcl directory.
Kent
2013-01-10 15:48:30 -06:00
Kent Mein
76adb1c7e3 Removed all of the non tcl version stuff. Or most of it anyway.
Kent
2013-01-10 15:44:49 -06:00
rkowen
845dd98749 * Let the "module-version" command use a "name" of '.' for "this"
module directory ... useful for deep modulefile directories.
2010-10-18 22:36:59 +00:00
rkowen
5cfdddb58a Rolled in the deep modulefile changes from version 3.2.8. 2010-10-07 22:08:05 +00:00