From 1309bbe0117b68f795f14f284a8293e3986fe02b Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Wed, 26 Dec 2012 13:47:11 +0000 Subject: Lazily pull the sources when building If no sources exists pull, otherwise leave it alone. --- (limited to 'devbot') 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 -- cgit v0.9.1