Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-11-27 13:42:04 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-27 13:43:07 (GMT)
commit3e0b6b5c3a863f3a2ad035e73bf5b58968757f8f (patch)
treee1540c262ee0ace06b06981361dcd90e113ce0fa
parent8ac3ac25a88116a137e7c1142648d09366af41df (diff)
Fix running on an unsupported distro
-rw-r--r--devbot/distro.py9
-rw-r--r--devbot/plugins/unknown.py37
-rw-r--r--devbot/system.py2
3 files changed, 46 insertions, 2 deletions
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