Roberto Beccherle wrote:
> My question is the following:
> How do i catch the error message and instead of exiting dump
> something nice to stderr or even better automatically unload
> the other version and load the correct one telling the user
> i have done so? Tcl provides catch but i was not able to use
> it... :(
Hello again!
As my head hit the pillow last night I remembered that I hadn't
tested "module switch" so I did so this morning... and of course
it caused an error. :-P
This modification seems to work with all sub-commands:
if {![module-info mode remove] && ![module-info mode switch] &&
[info exists env (SOFT_VER)]} {
puts stderr "Unloading version $env(SOFT_VER) first...\n"
module unload Test
}
setenv SOFT_VER verA
Note also that you'll need to remove the "conflict Software"
statments from the modulefiles as these will just result in
errors and the above statements won't be executed.
Cheers,
- Leo
|