Hi Xavier,
Thank you for your great work!
Our users and projects are using modulefiles (for years) in order to setup the shell environment for tools.
We try to use the following rule to create our module files:
<vendor>/<software>/<version>
(for GNU or other linux tools, <vendor> is set to utils: utils/<software>/<version>, for instance utils/make/4.0)
Thus, we want to be able to load 2 softwares of the same vendor but not 2 versions of the same software.
And in order to do that, we add the following line to our module files:
conflict <vendor>/<software>
When we use the module switch command, it is always in order to switch between two version of the same software. We never want to switch from one software to another, if we want to do that we just have to use unload and load. Thus, we never use the "module switch" command with 2 arguments.
So, when switching with only 1 argument, we would like "module" to automatically use the conflict information to determine the module to switch with.
If a conflicting module is already loaded, we want to switch with the conflicting module.
Otherwise, if no conflicting module is already loaded, we want the module switch command to behave as a module load command and not to switch with a random module (with the same root) as it is doing now!
As a result of this enhancement, the switch will only be able to switch between versions but not to switch between software.
For your information, we also use modulefiles to load the environment (and tools) of our projects.
In this case the naming rules are a little bit different:
project/<project_name>/<clone_dir>/<group>
As for software, we never want to have 2 projects environment loaded at the same time.
So every <group> module files has this line:
conflict project
The enhancement described previously would also work for this "project" case.
Thanks in advance for the answers.
Best regards.
Olivier
|