Bug 979787 - SourceVers wrongly sets version in nested directory
SourceVers wrongly sets version in nested directory
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: environment-modules (Show other bugs)
19
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Jan Synacek
Fedora Extras Quality Assurance
: EasyFix, Patch
Depends On:
Blocks: 979789
  Show dependency treegraph
 
Reported: 2013-06-30 11:15 EDT by Filip Krska
Modified: 2015-02-18 08:57 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 979789 (view as bug list)
Environment:
Last Closed: 2015-02-18 08:57:46 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Ignore version not located in current directory (707 bytes, patch)
2013-06-30 11:15 EDT, Filip Krska
fkrska: review?
Details | Diff

  None (edit)
Description Filip Krska 2013-06-30 11:15:41 EDT
Created attachment 767102 [details]
Ignore version not located in current directory

Description of problem:

SourceVers() doesn't ignore (and report as ERR_BADMODNAM) ModulesVersion if
set to module in nested directory. It doesn't comply with the documentation
`man modulefiles` which says:

Locating Modulefiles

...
 If the .version file exists, it is opened and interpreted as Tcl code and 
takes precedence over a .modulerc file in the same directory.  If the Tcl 
variable ModulesVersion is set by the .version file, modulecmd will use the
name as if it specifies a modulefile in the directory. This will become the
default module file in this case.  If ModulesVersion is a directory, the search
begins anew down that directory. If the name does  not  match  any  files
located in the ___current___ directory, the search continues through the
remaining directories in MODULEPATH.
...

Thus e.g. `module avail` wrongly diplays misleading information, that
nested module is default, but this is (as expected) ignored by e.g. `module load` commands.

Version-Release number of selected component (if applicable):

environment-modules-3.2.10-5.fc19

How reproducible:

Always

Steps to Reproduce:
1. create directory tree with modules as:
$ find $MODULEPATH 
/home/test2/modules
/home/test2/modules/compiler_a
/home/test2/modules/compiler_a/compiler_a.1.2
/home/test2/modules/compiler_a/compiler_a.1.0
/home/test2/modules/compiler_a/branch_7
/home/test2/modules/compiler_a/branch_7/compiler_a7.2.0
/home/test2/modules/compiler_a/branch_6
/home/test2/modules/compiler_a/branch_6/compiler_a6.2.0
/home/test2/modules/compiler_a/compiler_a.2.0
/home/test2/modules/compiler_a/compiler_a.2.1a
/home/test2/modules/compiler_a/.version
/home/test2/modules/compiler_b
/home/test2/modules/compiler_b/compiler_b.2.0
/home/test2/modules/compiler_b/compiler_b.2.1a
/home/test2/modules/compiler_b/compiler_b.1.0
/home/test2/modules/compiler_b/compiler_b.1.2

2. set the version

$ cat modules/compiler_a/.version 
#%Module1.0
##
set ModulesVersion "branch_7/compiler_a7.2.0"

3. execute

$ module avail -l

Actual results:

- Package -----------------------------+- Versions -+- Last mod. ------
/home/test2/modules:
compiler_a/branch_6/compiler_a6.2.0                  2013/06/11  7:33:59
compiler_a/branch_7/compiler_a7.2.0      default     2013/06/11  7:33:59
compiler_a/compiler_a.1.0                            2013/06/05 12:16:02
compiler_a/compiler_a.1.2                            2013/06/05 12:16:02
compiler_a/compiler_a.2.0                            2013/06/05 12:16:02
compiler_a/compiler_a.2.1a                           2013/06/05 12:16:02
compiler_b/compiler_b.1.0                            2013/06/05 12:16:02
compiler_b/compiler_b.1.2                            2013/06/05 12:16:02
compiler_b/compiler_b.2.0                            2013/06/05 12:16:02
compiler_b/compiler_b.2.1a                           2013/06/05 12:16:02

Expected results:

- Package -----------------------------+- Versions -+- Last mod. ------
/home/test2/modules:
compiler_a(6):PROB:155: Invalid modulename 'branch_7/compiler_a7.2.0' found
modules/compiler_a(6):PROB:155: Invalid modulename 'branch_7/compiler_a7.2.0' found
compiler_a/branch_6/compiler_a6.2.0                  2013/06/11  7:33:59
compiler_a/branch_7/compiler_a7.2.0                  2013/06/11  7:33:59
compiler_a/compiler_a.1.0                            2013/06/05 12:16:02
compiler_a/compiler_a.1.2                            2013/06/05 12:16:02
compiler_a/compiler_a.2.0                            2013/06/05 12:16:02
compiler_a/compiler_a.2.1a                           2013/06/05 12:16:02
compiler_b/compiler_b.1.0                            2013/06/05 12:16:02
compiler_b/compiler_b.1.2                            2013/06/05 12:16:02
compiler_b/compiler_b.2.0                            2013/06/05 12:16:02
compiler_b/compiler_b.2.1a                           2013/06/05 12:16:02


Additional info:
Comment 1 Jan Synacek 2013-07-09 04:10:39 EDT
Looking at the patch, what happens if the 'version' is specified with a './' ?
Comment 2 Filip Krska 2013-07-15 10:45:08 EDT
It will ignore that version. If I understand well the manual and behaviour of e.g. `module load` file existing in current directory is expected as the value of version. In that case adding './' prefix IMHO has no reason/use case, rather makes the conf files less readable. If there's a use case or user base using './' prefix already or if there's a plan to support version in nested directories for commands like `module load`, we are in different situation of course. Upstream may want to have their say here.
Comment 4 Fedora End Of Life 2015-01-09 17:10:31 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Fedora End Of Life 2015-02-18 08:57:46 EST
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.