[plt-scheme] OS version?

From: Anton van Straaten (anton at appsolutions.com)
Date: Fri Dec 9 03:44:26 EST 2005

Eli Barzilay wrote:
>>Major distributions often alter uname -a to report the distro name
>>as well as the kernel version.  [...]
> 
> 
> RedHat/Fedora don't do this.

I don't know if it's better or worse than what you already have, but the 
script on this page:

http://dev.i2p.net/pipermail/i2p-cvs/2004-August/003274.html

...uses a combination of "uname -a" and grepping /proc/version to figure 
out the distro (see the "osid" script).

One thing to note about /proc/version is that on at least some virtual 
servers, including both Virtuozzo and UML, the specified distribution is 
that of the host machine, but that's misleading for install purposes 
because the guest OS may be different.

There are also the following files (from 
http://www.fedoraforum.org/forum/archive/index.php/t-27768.html):

Novell SuSE 	/etc/SuSE-release
Red Hat 	/etc/redhat-release
Fedora 		/etc/fedora-release
Slackware 	/etc/slackware-release
Debian 		/etc/debian_release
Mandrake 	/etc/mandrake-release
Yellow dog 	/etc/yellowdog-release
Sun JDS 	/etc/sun-release
Solaris/Sparc 	/etc/release
Gentoo 		/etc/gentoo-release

I notice that on recent Debians at least, /etc/debian_release doesn't 
exist, but /etc_debian_version does.

 > Actually, the problem came up with a newer Ubuntu that has
 > "testing/unstable" in [/etc/debian_version].

I'm no expert, but isn't that because the current Debian stable release, 
and older releases, are the only ones with version numbers?  I also have 
"testing/unstable" in my /etc/debian_release on an official Debian AMD64 
setup (i.e. not Ubuntu).  Of course, "testing/unstable" could mean just 
about anything, depending on when the OS was last updated.

Anton


Posted on the users mailing list.