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-17 20:06:40 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-11-17 20:06:40 (GMT)
commitff6d17f224589ca13d85ffbc0e6c732646487a6f (patch)
tree5f98563879ead2d425cb2b174293b77c36c4811f
parentdfaf836ebd3f1f4807b147d8af5ca3fb8895d581 (diff)
Move files lists out of devbot
-rwxr-xr-xcommands/check-system1
-rw-r--r--commands/common.py20
-rw-r--r--devbot/config.py26
-rw-r--r--devbot/system.py2
4 files changed, 41 insertions, 8 deletions
diff --git a/commands/check-system b/commands/check-system
index 76914fb..99de7b4 100755
--- a/commands/check-system
+++ b/commands/check-system
@@ -1,6 +1,7 @@
#!/usr/bin/python
import argparse
+import os
import common
diff --git a/commands/common.py b/commands/common.py
index 4197912..20df94c 100644
--- a/commands/common.py
+++ b/commands/common.py
@@ -7,6 +7,7 @@ sys.path.append(base_path)
from devbot import system
from devbot import config
+from devbot import distro
def setup():
config.set_config_dir(os.path.join(base_path, "config"))
@@ -15,3 +16,22 @@ def setup():
config.set_build_dir(os.path.join(base_path, "build"))
config.set_commands_dir(os.path.join(base_path, "commands"))
config.set_logs_dir(os.path.join(base_path, "logs"))
+
+ version = distro.get_system_version()
+
+ module_files = ["system-%s.json" % version,
+ "sugar.json",
+ "activities.json"]
+
+ config.set_module_files(module_files)
+
+ dep_files = ["system",
+ "sugar-build",
+ "sugar-buildtime-%s" % version,
+ "sugar-runtime-%s" % version]
+
+ config.set_dep_files(dep_files)
+
+ package_files = ["packages-%s" % version]
+
+ config.set_package_files(package_files)
diff --git a/devbot/config.py b/devbot/config.py
index 4249dca..bd25cf7 100644
--- a/devbot/config.py
+++ b/devbot/config.py
@@ -14,6 +14,9 @@ devbot_dir = None
share_dir = None
bin_dir = None
etc_dir = None
+dep_files = None
+module_files = None
+package_files = None
use_lib64 = os.uname()[4] == "x86_64"
if use_lib64:
@@ -60,6 +63,18 @@ def set_commands_dir(dir):
global commands_dir
commands_dir = dir
+def set_dep_files(files):
+ global dep_files
+ dep_files = files
+
+def set_module_files(files):
+ global module_files
+ module_files = files
+
+def set_package_files(files):
+ global package_files
+ package_files = files
+
def get_module_source_dir(module):
return os.path.join(source_dir, module["name"])
@@ -67,7 +82,9 @@ def get_module_build_dir(module):
return os.path.join(build_dir, module["name"])
def load_packages():
- return _load_deps_json("packages-%s" % distro.get_system_version())
+ packages = []
+ for package_file in package_files:
+ packages.extend(_load_deps_json(package_file))
def load_prerequisites():
return _load_deps_json("prerequisites")
@@ -75,13 +92,8 @@ def load_prerequisites():
def load_checks():
version = distro.get_system_version()
- check_files = ["system",
- "sugar-build",
- "sugar-buildtime-%s" % version,
- "sugar-runtime-%s" % version]
-
checks = []
- for check_file in check_files:
+ for check_file in dep_files:
checks.extend(_load_deps_json(check_file))
return checks
diff --git a/devbot/system.py b/devbot/system.py
index f783bd8..a69c2bd 100644
--- a/devbot/system.py
+++ b/devbot/system.py
@@ -160,7 +160,7 @@ def remove_packages(package_manager, packages):
package_manager.remove_packages(to_remove)
def check(remove=False, update=False, test=False, interactive=True):
- package_manager =
+ package_manager = \
distro.get_package_manager(test=test, interactive=interactive)
distro_name = distro.get_distro_name()