diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-17 22:12:14 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-17 22:12:14 (GMT) |
commit | 72cf705dd6b93a405c90c3f904c224ac2b122eb0 (patch) | |
tree | cb57e5e72b791b83ecb0aaef99d6d5ca63b75b96 | |
parent | 818833eb3b5ec8dc5eeae7aa9c12435501d5c486 (diff) |
Move packages json to a separate dir
-rw-r--r-- | commands/common.py | 8 | ||||
-rw-r--r-- | config/packages/buildslave.json (renamed from config/deps/buildslave.json) | 0 | ||||
-rw-r--r-- | config/packages/deps-3.4.json (renamed from config/deps/packages-3.4.json) | 0 | ||||
-rw-r--r-- | config/packages/deps-3.6.json (renamed from config/deps/packages-3.6.json) | 0 | ||||
-rw-r--r-- | devbot/config.py | 23 |
5 files changed, 14 insertions, 17 deletions
diff --git a/commands/common.py b/commands/common.py index b60ae67..05c67b6 100644 --- a/commands/common.py +++ b/commands/common.py @@ -30,11 +30,11 @@ def setup(): "sugar-buildtime-%s" % version, "sugar-runtime-%s" % version] - if "SUGAR_BUILDBOT" in os.environ: - dep_files.append("buildslave") - config.set_dep_files(dep_files) - package_files = ["packages-%s" % version] + package_files = ["deps-%s" % version] + + if "SUGAR_BUILDBOT" in os.environ: + package_files.append("buildslave") config.set_package_files(package_files) diff --git a/config/deps/buildslave.json b/config/packages/buildslave.json index ee794ac..ee794ac 100644 --- a/config/deps/buildslave.json +++ b/config/packages/buildslave.json diff --git a/config/deps/packages-3.4.json b/config/packages/deps-3.4.json index 9ffabd8..9ffabd8 100644 --- a/config/deps/packages-3.4.json +++ b/config/packages/deps-3.4.json diff --git a/config/deps/packages-3.6.json b/config/packages/deps-3.6.json index f52a5e8..f52a5e8 100644 --- a/config/deps/packages-3.6.json +++ b/config/packages/deps-3.6.json diff --git a/devbot/config.py b/devbot/config.py index 70f9180..abd3e94 100644 --- a/devbot/config.py +++ b/devbot/config.py @@ -84,22 +84,23 @@ def get_module_build_dir(module): def load_packages(): packages = {} - for package_file in package_files: - deps = _load_deps_json(package_file) - for key, value in deps.items(): - packages[key] = value + for file in package_files: + path = os.path.join(config_dir, "packages", "%s.json" % file) + packages.update(json.load(open(path))) return packages def load_prerequisites(): - return _load_deps_json("prerequisites") + path = os.path.join(config_dir, "deps", "prerequisites.json") + return json.load(open(path)) def load_checks(): version = distro.get_system_version() checks = [] - for check_file in dep_files: - checks.extend(_load_deps_json(check_file)) + for file in dep_files: + path = os.path.join(config_dir, "deps", "%s.json" % file) + checks.extend(json.load(open(path))) return checks @@ -112,12 +113,8 @@ def load_modules(): modules = [] - for module_file in module_files: - path = os.path.join(config_dir, "modules", module_file) + for file in module_files: + path = os.path.join(config_dir, "modules", file) modules.extend(json.load(open(path))) return modules - -def _load_deps_json(name): - path = os.path.join(config_dir, "deps", "%s.json" % name) - return json.load(open(path)) |