Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/check-system31
-rw-r--r--scripts/sysinfo.py28
2 files changed, 31 insertions, 28 deletions
diff --git a/scripts/check-system b/scripts/check-system
index 65c1ed5..fb80391 100755
--- a/scripts/check-system
+++ b/scripts/check-system
@@ -5,6 +5,8 @@ import os
import subprocess
import sys
+import sysinfo
+
scriptdir = os.path.dirname(__file__)
devnull = open("/dev/null", "w")
xvfb_display = ":100"
@@ -131,33 +133,6 @@ def stop_xvfb(proc, orig_display):
xvfb_proc.terminate()
-def check_distro():
- distro = "unsupported"
-
- # Fedora
- try:
- fedora_release = open("/etc/fedora-release").read().strip()
- if fedora_release == "Fedora release 17 (Beefy Miracle)":
- distro = "fedora"
- except IOError:
- pass
-
- # Ubuntu
- try:
- distributor = subprocess.check_output(["lsb_release", "-si"]).strip()
- release = subprocess.check_output(["lsb_release", "-sr"]).strip()
-
- if distributor == "Ubuntu" and release == "12.04":
- distro = "ubuntu"
- except OSError:
- pass
-
- arch = subprocess.check_output(["uname", "-i"]).strip()
- if arch not in ["i386", "i686", "x86_64"]:
- distro = "unsupported"
-
- return distro
-
def apply_ubuntu_tweaks():
wrapper_config = open("/etc/X11/Xwrapper.config").read()
if "allowed_users=anybody" not in wrapper_config:
@@ -183,7 +158,7 @@ def warn_if_unsupported(distro):
"distributions listed in the README.\n" \
"*********************************************************\n"
-distro = check_distro()
+distro = sysinfo.get_distro_name()
packages = load_deps_json("packages")
diff --git a/scripts/sysinfo.py b/scripts/sysinfo.py
new file mode 100644
index 0000000..3b9b94b
--- /dev/null
+++ b/scripts/sysinfo.py
@@ -0,0 +1,28 @@
+import subprocess
+
+def get_distro_name():
+ distro = "unsupported"
+
+ # Fedora
+ try:
+ fedora_release = open("/etc/fedora-release").read().strip()
+ if fedora_release == "Fedora release 17 (Beefy Miracle)":
+ distro = "fedora"
+ except IOError:
+ pass
+
+ # Ubuntu
+ try:
+ distributor = subprocess.check_output(["lsb_release", "-si"]).strip()
+ release = subprocess.check_output(["lsb_release", "-sr"]).strip()
+
+ if distributor == "Ubuntu" and release == "12.04":
+ distro = "ubuntu"
+ except OSError:
+ pass
+
+ arch = subprocess.check_output(["uname", "-i"]).strip()
+ if arch not in ["i386", "i686", "x86_64"]:
+ distro = "unsupported"
+
+ return distro