John Mincarelli wrote:
> I have been using modules for a long time and recently ran into a
> problem with the Modules 3.1.0b version of modules on Linux. When
> I use Modules 2.2beta with a module file that has a case statement
> it seems to work fine. In the example below the case statement
> parses out a piece of the "uname" and sets variables accordingly.
>
> When I use 3.1.0b it seems that the module file will not work with
> the case statement unless the case is only for Linux.
>
> Has anyone else seen this behavior ?
>
> Sample code:
>
> case $env(OS_TYPE) {
> { "Linux.2.2*" } {
> set arch intel_i686_linux_2.2
> }
> { "SunOS.5.*" } {
> set arch sun_sparc_solaris_5.5.1
> }
> }
> prepend-path PATH /path/$arch
Hello, John.
We've been using "switch -glob $var" for our case statements;
is that what you're doing? Our code looks like the following:
set os [uname sysname]
set rev [uname release]
switch -glob $os {
Linux {
# Assume only one kernel to worry about here
set arch intel_i686_linux_2.2
}
SunOS {
# Multiple of these
switch -glob $rev {
5.5* {
set arch sun_sparc_solaris_5.5.1
}
5.6* {
set arch sun_sparc_solaris_5.6
}
5.7* {
set arch sun_sparc_solaris_5.7
}
}
}
}
This works like a champ for us under modules 2.2b and 3.1.0b
on the SunOS side; are you having trouble with this on SunOS,
Linux, or both?
Regards,
- Leo Butler
|