diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-15 18:05:33 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-11-15 18:05:33 (GMT) |
commit | 4fdccd18214412a288897e934d6583aafbc5fa5d (patch) | |
tree | 5ffcb4d5f6739796ae037f9ad0a9c9f0eb91719b /devbot | |
parent | 425ae8a66aac4fe9e8f181e0de4b8bb7d0777087 (diff) |
Use the command module
Diffstat (limited to 'devbot')
-rw-r--r-- | devbot/build.py | 23 | ||||
-rw-r--r-- | devbot/command.py | 2 |
2 files changed, 11 insertions, 14 deletions
diff --git a/devbot/build.py b/devbot/build.py index 22c1ccf..dfb98b5 100644 --- a/devbot/build.py +++ b/devbot/build.py @@ -9,6 +9,7 @@ import shutil import sys import subprocess +from devbot import command from devbot import config from devbot import environ @@ -53,10 +54,6 @@ def get_module_commit_id(module): return commit_id.strip() -def run_command(args): - print " ".join(args) - subprocess.check_call(args) - def unlink_libtool_files(): orig_cwd = os.getcwd() os.chdir(config.lib_dir) @@ -72,33 +69,33 @@ def pull_source(module): if os.path.exists(module_dir): os.chdir(module_dir) - run_command(["git", "remote", "set-url", "origin", module["repo"]]) - run_command(["git", "remote", "update", "origin"]) + command.run(["git", "remote", "set-url", "origin", module["repo"]]) + command.run(["git", "remote", "update", "origin"]) else: os.chdir(config.source_dir) - run_command(["git", "clone", "--progress", + command.run(["git", "clone", "--progress", module["repo"], module["name"]]) - os.chdir(module_dir) + command.run([module_dir]) branch = module.get("branch", "master") - run_command(["git", "checkout", branch]) + command.run(["git", "checkout", branch]) def build_autotools(module): autogen = os.path.join(get_module_source_dir(module), "autogen.sh") jobs = multiprocessing.cpu_count() * 2 - run_command([autogen, + command.run([autogen, "--prefix", config.install_dir, "--libdir", config.lib_dir]) - run_command(["make", "-j", "%d" % jobs]) - run_command(["make", "install"]) + command.run(["make", "-j", "%d" % jobs]) + command.run(["make", "install"]) unlink_libtool_files() def build_activity(module): - run_command(["./setup.py", "install", "--prefix", config.install_dir]) + command.run(["./setup.py", "install", "--prefix", config.install_dir]) def build_module(module): module_source_dir = get_module_source_dir(module) diff --git a/devbot/command.py b/devbot/command.py index 8da8051..32a5a6a 100644 --- a/devbot/command.py +++ b/devbot/command.py @@ -1,6 +1,6 @@ import subprocess -def run_command(args, test=False): +def run(args, test=False): print " ".join(args) if not test: subprocess.check_call(args) |