From 3e0b6b5c3a863f3a2ad035e73bf5b58968757f8f Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Tue, 27 Nov 2012 13:42:04 +0000 Subject: Fix running on an unsupported distro --- (limited to 'devbot') diff --git a/devbot/distro.py b/devbot/distro.py index 441fbc1..06bffee 100644 --- a/devbot/distro.py +++ b/devbot/distro.py @@ -19,7 +19,14 @@ def get_package_manager(test=False, interactive=True): def get_distro_info(): global _distros_info + + unknown_distro = None + for info_class in _distros_info: info = info_class() - if info.valid: + if info.name == "unknown": + unknown_distro = info + elif info.valid: return info + + return unknown_distro diff --git a/devbot/plugins/unknown.py b/devbot/plugins/unknown.py new file mode 100644 index 0000000..ea42112 --- /dev/null +++ b/devbot/plugins/unknown.py @@ -0,0 +1,37 @@ +import os +import subprocess + +from devbot import command +from devbot import distro +from devbot.plugins import interfaces + +class PackageManager(interfaces.PackageManager): + def __init__(self, test=False, interactive=True): + pass + + def install_packages(self, packages): + pass + + def remove_packages(self, packages): + pass + + def update(self): + pass + + def find_all(self): + return [] + + def find_with_deps(self, packages): + return [] + +distro.register_package_manager("unknown", PackageManager) + +class DistroInfo(interfaces.DistroInfo): + def __init__(self): + self.use_lib64 = os.path.exists("/usr/lib64") + self.name = "unknown" + self.version = "unknown" + self.system_version = "3.4" + self.valid = True + +distro.register_distro_info(DistroInfo) diff --git a/devbot/system.py b/devbot/system.py index 4e7ce8c..7b74104 100644 --- a/devbot/system.py +++ b/devbot/system.py @@ -95,7 +95,7 @@ def run_checks(package_manager, checks, packages): package_manager.install_packages(to_install) if failed_checks: - print "Failed checks\n" + print "\nFailed checks:" else: return True -- cgit v0.9.1