Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-27 17:29:10 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-27 17:29:10 (GMT)
commit8a64d0947bb9a3afcc303015ee4bd8835be03a62 (patch)
tree456d39919b824464b5d9cb24115ba9728915d7bd /devbot
parent6ab02c1f23631f8e87615610ed811bc4bf31accc (diff)
Refactor to avoid circular dependency
Diffstat (limited to 'devbot')
-rw-r--r--devbot/build.py9
-rw-r--r--devbot/config.py6
-rw-r--r--devbot/git.py10
-rw-r--r--devbot/state.py4
4 files changed, 17 insertions, 12 deletions
diff --git a/devbot/build.py b/devbot/build.py
index 9193b04..d2631db 100644
--- a/devbot/build.py
+++ b/devbot/build.py
@@ -12,6 +12,7 @@ from devbot import environ
from devbot import state
from devbot import utils
from devbot import release
+from devbot import git
_builders = {}
_distributors = {}
@@ -42,7 +43,7 @@ def pull(lazy=False):
to_pull = []
for module in config.load_modules():
- git_module = module.get_git_module()
+ git_module = git.get_module(module)
if not lazy or not os.path.exists(git_module.local):
to_pull.append(module)
@@ -111,7 +112,7 @@ def clean():
for module in config.load_modules():
if not module.out_of_source:
- if module.get_git_module().clean():
+ if git.get_module(module).clean():
print "* Cleaning %s" % module.name
@@ -135,7 +136,7 @@ def _unlink_libtool_files():
def _pull_module(module):
print "* Pulling %s" % module.name
- git_module = module.get_git_module()
+ git_module = git.get_module(module)
try:
git_module.update()
@@ -191,7 +192,7 @@ def _distribute_autotools(module):
filename = makefile["DIST_ARCHIVES"]
version = makefile["VERSION"]
- git_module = module.get_git_module()
+ git_module = git.get_module(module)
version_revision = None
description = git_module.describe()
diff --git a/devbot/config.py b/devbot/config.py
index 24d095a..3faf2f4 100644
--- a/devbot/config.py
+++ b/devbot/config.py
@@ -6,7 +6,6 @@ import tempfile
from devbot import distro
from devbot import plugins
-from devbot import git
from devbot import utils
from devbot import command
@@ -52,11 +51,6 @@ class Module:
def get_build_dir(self):
return os.path.join(get_build_dir(), self.name)
- def get_git_module(self):
- return git.Module(path=get_source_dir(), name=self.name,
- remote=self.repo, branch=self.branch, tag=self.tag,
- retry=10)
-
def get_build_system(self):
source_dir = self.get_source_dir()
if os.path.exists(os.path.join(source_dir, "setup.py")):
diff --git a/devbot/git.py b/devbot/git.py
index 4e7d86c..f2da84d 100644
--- a/devbot/git.py
+++ b/devbot/git.py
@@ -3,6 +3,7 @@ import subprocess
from devbot import command
from devbot import utils
+from devbot import config
_root_path = None
@@ -128,6 +129,15 @@ def set_root_path(path):
_root_path = path
+def get_module(module):
+ return Module(path=config.get_source_dir(),
+ name=module.name,
+ remote=module.repo,
+ branch=module.branch,
+ tag=module.tag,
+ retry=10)
+
+
def get_root_module():
remote = "git://git.sugarlabs.org/sugar-build/sugar-build.git"
diff --git a/devbot/state.py b/devbot/state.py
index 40a9c76..4fdc363 100644
--- a/devbot/state.py
+++ b/devbot/state.py
@@ -11,7 +11,7 @@ _SYSTEM_CHECK = "syscheck"
def built_module_touch(module):
- git_module = module.get_git_module()
+ git_module = git.get_module(module)
built_modules = _load_state(_BUILT_MODULES, {})
info = {"commit": git_module.get_commit_id(),
@@ -22,7 +22,7 @@ def built_module_touch(module):
def built_module_is_unchanged(module):
- git_module = module.get_git_module()
+ git_module = git.get_module(module)
built_modules = _load_state(_BUILT_MODULES, {})
if module.name not in built_modules:
return False