Interestingly, the first hit for me when googling tcl lsb_release is a post
from this mailing list from 2006 :)
https://sourceforge.net/p/modules/mailman/message/2788950/
The nice thing about this approach is that lsb_release output should be
consistent across all Linux distributions, with the caveat that you'll need
to have lsb_release available on all of your systems.
I've simply been parsing the output of [uname release], which is the same
as uname -r, however it gets increasingly complicated, especially across
major distros.
On Thu, Aug 3, 2017 at 1:39 PM, Sternberg, Michael G. <ste...@an...>
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
>
|