From b857a4ff09d3ec69211a655888e7bb64105303bd Mon Sep 17 00:00:00 2001 From: Jannis Pohlmann Date: Thu, 3 May 2012 10:46:23 +0000 Subject: Integrate RemoteArtifactCache into the building process. For now we do not provide an option to avoid downloading artifacts during build. Unsetting --cache-server is an option but it's not user-friendly. Of course if there is no network connection, then downloading will fail and things will be built locally. We may want to add a generic --no-network switch to replace/extend --no-git-update later. --- morph | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'morph') diff --git a/morph b/morph index b2c0e44c..c28ccf15 100755 --- a/morph +++ b/morph @@ -185,6 +185,11 @@ class Morph(cliapp.Application): ckc = morphlib.cachekeycomputer.CacheKeyComputer(build_env) lac = morphlib.localartifactcache.LocalArtifactCache( os.path.join(cachedir, 'artifacts')) + if self.settings['cache-server']: + rac = morphlib.remoteartifactcache.RemoteArtifactCache( + self.settings['cache-server']) + else: + rac = None lrc = morphlib.localrepocache.LocalRepoCache( os.path.join(cachedir, 'gits'), self.settings['git-base-url'], @@ -220,7 +225,8 @@ class Morph(cliapp.Application): for group in order.groups: for artifact in group: if not lac.has(artifact): - needed.append(artifact) + if not rac or not rac.has(artifact): + needed.append(artifact) logging.debug('cmd_build: cloning/updating cached repos') done = set() @@ -258,8 +264,8 @@ class Morph(cliapp.Application): self._install_initial_staging(staging_area) builder = morphlib.builder2.Builder( - staging_area, lac, lrc, - build_env, self.settings['max-jobs']) + staging_area, lac, rac, lrc, build_env, + self.settings['max-jobs']) if setup_proc: builder.setup_proc = True -- cgit v1.2.1