Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot/plugins/ubuntu.py
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-28 13:49:15 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-28 13:49:15 (GMT)
commitd67e269de9e21ce4ad4cd1608cc8b0ff969c0642 (patch)
tree1248fbe24ac685f0d1eee39433d21a5bd505d30c /devbot/plugins/ubuntu.py
parent19682716ac2d00cfb378bb83db9195bd3ac62135 (diff)
Improve feedback for non supported distributions
If we are on a distribution which is known, but the version or the architecture is not supported, suggest a list of packages to install.
Diffstat (limited to 'devbot/plugins/ubuntu.py')
-rw-r--r--devbot/plugins/ubuntu.py44
1 files changed, 26 insertions, 18 deletions
diff --git a/devbot/plugins/ubuntu.py b/devbot/plugins/ubuntu.py
index 4b624e1..4f1fb91 100644
--- a/devbot/plugins/ubuntu.py
+++ b/devbot/plugins/ubuntu.py
@@ -84,28 +84,36 @@ distro.register_package_manager("ubuntu", PackageManager)
class DistroInfo(interfaces.DistroInfo):
def __init__(self):
- self.name = None
- self.version = None
- self.system_version = None
- self.valid = False
- self.use_lib64 = False
-
arch = subprocess.check_output(["uname", "-i"]).strip()
- if arch in ["i386", "i686", "x86_64"]:
- try:
- if self._get_distributor() == "Ubuntu" and \
- self._get_release() == "12.10":
- self.name = "ubuntu"
- self.version = "12.10"
- self.system_version = "3.6"
- self.valid = True
- except OSError:
- pass
+
+ self.name = "ubuntu"
+ self.version = "unknown"
+ self.system_version = "3.4"
+ self.valid = True
+ self.supported = (arch in ["i386", "i686", "x86_64"])
+ self.use_lib64 = False
+
+ if self._get_distributor() != "Ubuntu":
+ self.valid = False
+
+ self.version = self._get_release()
+
+ if self.version != "12.10":
+ self.supported = False
+
+ if self.version and self.version > "12.10":
+ self.system_version = "3.6"
def _get_distributor(self):
- return subprocess.check_output(["lsb_release", "-si"]).strip()
+ try:
+ return subprocess.check_output(["lsb_release", "-si"]).strip()
+ except OSError:
+ None
def _get_release(self):
- return subprocess.check_output(["lsb_release", "-sr"]).strip()
+ try:
+ return subprocess.check_output(["lsb_release", "-sr"]).strip()
+ except OSError:
+ return None
distro.register_distro_info(DistroInfo)