diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2014-12-20 20:29:19 +0000 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2014-12-20 21:10:15 +0000 |
commit | 052fa53b99378d864f21761b7e6f02d23f9156e4 (patch) | |
tree | ad05147ef69bff58b19df8e4ecc65e4fbbe80965 /morphlib/buildcommand.py | |
parent | f33748d6e6795751e7ea628d5f4e8478353a88ee (diff) | |
download | morph-baserock/ps/wip-ybd-hack.tar.gz |
WIP hack of ybd into new morph assemble commandbaserock/ps/wip-ybd-hack
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r-- | morphlib/buildcommand.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 527163f6..bcc7f5e8 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -50,6 +50,31 @@ class BuildCommand(object): self.lac, self.rac = self.new_artifact_caches() self.lrc, self.rrc = self.new_repo_caches() + def assemble(self, target): + defs = morphlib.definitions.Definitions() + this = defs.get(target) + if defs.lookup(this, 'repo') != [] and defs.lookup(this, 'tree') == []: + this['tree'] = repos.get_tree(this) + + if morphlib.cache.get_cache(this): + yapp.log(this, 'Cache found', morphlib.cache.get_cache(this)) + return + + with yapp.timer(this, 'Starting assembly'): + build_env = BuildEnvironment(yapp.settings) + stage = StagingArea(this, build_env) + for dependency in defs.lookup(this, 'build-depends'): + assemble(defs.get(dependency)) + stage.install_artifact(dependency) + + # if we're distbuilding, wait here for all dependencies to complete + # how do we know when that happens? + + for component in defs.lookup(this, 'contents'): + assemble(defs.get(component)) + + build(this) + def build(self, repo_name, ref, filename, original_ref=None): '''Build a given system morphology.''' |