From 5dcf454dacb1a104fea90735f9a0fa2d76854faf Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Mon, 26 Nov 2012 11:59:04 +0000 Subject: Add a DistroInfo class --- (limited to 'devbot/plugins/ubuntu.py') diff --git a/devbot/plugins/ubuntu.py b/devbot/plugins/ubuntu.py index 9cc210d..693a227 100644 --- a/devbot/plugins/ubuntu.py +++ b/devbot/plugins/ubuntu.py @@ -80,3 +80,28 @@ class PackageManager: return result distro.register_package_manager("ubuntu", PackageManager) + +class DistroInfo: + def __init__(self): + self.name = None + self.version = None + self.system_version = None + self.valid = False + self.use_lib64 = False + + 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 + + def _get_distributor(self): + return subprocess.check_output(["lsb_release", "-si"]).strip() + + def _get_release(self): + return subprocess.check_output(["lsb_release", "-sr"]).strip() -- cgit v0.9.1