Hi Michael,
good idea, too. In our case we have two almost identical software
stacks, one for openSuSE and one for CentOS which are basically
maintained in parallel (let's not discuss if that makes sense, it has
historical reasons...). Hence the modulefiles are basically identical
with the only difference being the base bath of the software stack. I'd
therefore prefer to have a single modulefile per package which can
differentiate from which distro it has been called. Two separate
modulefile trees would add yet an other redundancy. However if the two
software stacks weren't 90% identical, I'd also go for this solution.
frank
On 08/03/2017 08:39 PM, Sternberg, Michael G. wrote:
> Frank,
>
> Distro-detection and distro-specific code inside individual modulefiles would be repetitive and fragile, and would quickly become difficult to maintain. For a multi-distro system here, I use several modulefile trees, presenting distro-specific trees before shared ones:
>
> $ echo $MODULEPATH
> /opt/apps/M/el6:/opt/apps/M/el:/usr/share/Modules/modulefiles:/etc/modulefiles
>
>
> To add to what Paul just wrote, lsb_release(1) is provided on CentOS by package redhat-lsb-core. As part of scripts in /etc/profile.d/, I use:
>
> $ lsb_release -sir
> CentOS 6.9
>
> Has a nice ring to it and is easy to parse.
>
>
> With best regards,
> Michael
>
>
>> On 2017-08-03, at 12:53 , Frank Thommen <f.t...@dk...> wrote:
>> I am currently trying to generalize our modulefiles so that the same file can be used for different Linux distros. For historical reasons, openSuSE and CentOS hosts @work have different base paths of their respective software stack.
>>
>> Therefore my question: Is there a simple Tcl command that allows me to detect the current Linux distribution or how could I detect it otherwise? I can do it with bash, but I have no knowledge of Tcl other than our very basic and simple modulefiles.
>>
>> Any hint is appreciated.
>>
>> Cheers
>> frank
>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
--
Frank Thommen | DKFZ Heidelberg / B080
| System Administrator
| f.t...@dk...
| MMK: +49-6221-42-3637 (Mo-Mi, Fr)
| IPMB: +49-6221-54-5823 (Do)
|