Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/scripts/sysinfo.py
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-11 14:30:50 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-11 14:30:50 (GMT)
commit2694e6c093e373aade4e448529480d1a52c8bffc (patch)
tree19ee20ec6651539671d742dc04e7e0f05b5cd0b8 /scripts/sysinfo.py
parent5f79844e11d6a355b4b6cb3a0bcff6866fedbdc7 (diff)
Drop support for Ubuntu 12.04
Add support for Ubuntu 12.10 and Fedora 18
Diffstat (limited to 'scripts/sysinfo.py')
-rw-r--r--scripts/sysinfo.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/scripts/sysinfo.py b/scripts/sysinfo.py
index 3b9b94b..34f54bc 100644
--- a/scripts/sysinfo.py
+++ b/scripts/sysinfo.py
@@ -1,13 +1,30 @@
import subprocess
+def get_system_version():
+ name, version = _get_distro_info()
+ if (name == "ubuntu" and version == "12.10") or \
+ (name == "fedora" and version == "18"):
+ return "3.6"
+ else:
+ return "3.4"
+
def get_distro_name():
+ name, version = _get_distro_info()
+ return name
+
+def _get_distro_info():
distro = "unsupported"
+ version = "unknown"
# Fedora
try:
fedora_release = open("/etc/fedora-release").read().strip()
if fedora_release == "Fedora release 17 (Beefy Miracle)":
distro = "fedora"
+ version = "17"
+ elif fedora_release == "Fedora release 18 (Spherical Cow)":
+ distro = "fedora"
+ version = "18"
except IOError:
pass
@@ -16,13 +33,15 @@ def get_distro_name():
distributor = subprocess.check_output(["lsb_release", "-si"]).strip()
release = subprocess.check_output(["lsb_release", "-sr"]).strip()
- if distributor == "Ubuntu" and release == "12.04":
+ if distributor == "Ubuntu" and release == "12.10":
distro = "ubuntu"
+ version = "12.10"
except OSError:
pass
arch = subprocess.check_output(["uname", "-i"]).strip()
if arch not in ["i386", "i686", "x86_64"]:
- distro = "unsupported"
+ distro = "unsupported"
+ version = "unknown"
- return distro
+ return distro, version