Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot/build.py
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-26 13:47:11 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-26 13:47:11 (GMT)
commit1309bbe0117b68f795f14f284a8293e3986fe02b (patch)
tree0f126401d20709b4b397ce519ca88d7ede527fb0 /devbot/build.py
parente8fe2479c6224f18a6434049b4923f966e865119 (diff)
Lazily pull the sources when building
If no sources exists pull, otherwise leave it alone.
Diffstat (limited to 'devbot/build.py')
-rw-r--r--devbot/build.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/devbot/build.py b/devbot/build.py
index 5c35999..b51f0cf 100644
--- a/devbot/build.py
+++ b/devbot/build.py
@@ -37,11 +37,11 @@ def pull_one(module_name):
return False
-def pull():
+def pull(lazy=False):
environ.setup()
for module in config.load_modules():
- if not _pull_module(module):
+ if not _pull_module(module, lazy):
return False
return True
@@ -58,6 +58,8 @@ def build(full=False):
state.full_build_touch()
+ pull(lazy=True)
+
for module in config.load_modules():
if state.built_module_is_unchanged(module):
print "\n* Skipping unchanged module %s *" % module.name
@@ -107,11 +109,15 @@ def _unlink_libtool_files():
os.path.walk(config.lib_dir, func, None)
-def _pull_module(module):
+def _pull_module(module, lazy=False):
+ git_module = module.get_git_module()
+ if lazy and os.path.exists(git_module.local):
+ return True
+
print "\n=== Pulling %s ===\n" % module.name
try:
- module.get_git_module().update()
+ git_module.update()
except subprocess.CalledProcessError:
return False