<p dir="ltr">On Jun 19, 2014 2:32 AM, "Miroslav Suchý" <<a href="mailto:msuchy@redhat.com">msuchy@redhat.com</a>> wrote:<br>
><br>
> On 06/10/2014 05:19 PM, Fred Smith wrote:<br>
> > What I'm not sure of is what would be a better way for an app installer<br>
> > to find out which OS version it's being installed on. Can someone offer<br>
> > me some enlightenment<br>
><br>
> /etc/os-release<br>
><br>
> <a href="http://www.freedesktop.org/software/systemd/man/os-release.html">http://www.freedesktop.org/software/systemd/man/os-release.html</a></p>
<p dir="ltr">If you use Python, its standard library has a pretty good platform module for these kinds of things, which works even beyond Linux and even to somewhat old versions of distros.</p>
<p dir="ltr">Features that are introduced by systemd can't be assumed as present except on those (recent) Linux OS versions which are using systemd, and can almost be assumed absent outside the Linux world (such as Solaris, BSD, Win/Mac). A few non-systemd Linux distros do ship /etc/os-release, especially those distro preparing to adopt systemd like Debian and Ubuntu - but even there only in recent or unreleased versions.</p>
<p dir="ltr">By far the most portable platform detection system is know is GNU autoconf's config.guess, but that may be overkill. :)</p>
<p dir="ltr">- Jimmy</p>