On Tue, Jan 19, 2016 at 7:42 PM, Russel Winder <[email protected]> wrote:
> def which_posix():
> with open('/etc/os-release') as f:
> for line in f:
> if 'ID' in line:
> return {
> 'debian': OS_Type.linux_debian,
> 'fedora': OS_Type.linux_fedora,
> }[line.split('=')[1].strip()]
> return OS_Type.posix
>
On an Ubuntu machine, /etc/os-release is:
sanjeev@X201wily:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04 (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
UBUNTU_CODENAME=xenial
sanjeev@X201wily:~$
--
Sanjeev Gupta
+65 98551208 http://www.linkedin.com/in/ghane
_______________________________________________
Scons-dev mailing list
[email protected]
https://pairlist2.pair.net/mailman/listinfo/scons-dev