diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2014-10-24 16:09:45 +0000 |
---|---|---|
committer | Sam Thursfield <sam@afuera.me.uk> | 2014-10-24 16:33:39 +0000 |
commit | 8df5d7df210f9c712c2377cecc6f3f3a7efce01a (patch) | |
tree | 07bae67a7f210b3713af56d883604e594964eb17 /morphlib/buildcommand.py | |
parent | 1d6451363c92ec5466b01b5ba2fd327066343ab4 (diff) | |
download | morph-8df5d7df210f9c712c2377cecc6f3f3a7efce01a.tar.gz |
build: Restructure how BuildCommand.build() is called
Rather than take a list of triplets to build, the BuildCommand.build()
function now takes a single repo/ref/morph triplet. Iterating through
multiple sets of triplets is now done in the build plugin.
There are a couple of cosmetic changes to the status output at the start
and end of a build as a result.
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r-- | morphlib/buildcommand.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index 7eb6c0ab..650ee13a 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -50,21 +50,23 @@ class BuildCommand(object): self.lac, self.rac = self.new_artifact_caches() self.lrc, self.rrc = self.new_repo_caches() - def build(self, args): - '''Build triplets specified on command line.''' + def build(self, repo_name, ref, filename): + '''Build a given system morphology.''' - self.app.status(msg='Build starts', chatty=True) + self.app.status( + msg='Building %(repo_name)s %(ref)s %(filename)s', + repo_name=repo_name, ref=ref, filename=filename) - for repo_name, ref, filename in self.app.itertriplets(args): - self.app.status(msg='Building %(repo_name)s %(ref)s %(filename)s', - repo_name=repo_name, ref=ref, filename=filename) - self.app.status(msg='Deciding on task order') - srcpool = self.create_source_pool(repo_name, ref, filename) - self.validate_sources(srcpool) - root_artifact = self.resolve_artifacts(srcpool) - self.build_in_order(root_artifact) + self.app.status(msg='Deciding on task order') + srcpool = self.create_source_pool(repo_name, ref, filename) + self.validate_sources(srcpool) + root_artifact = self.resolve_artifacts(srcpool) + self.build_in_order(root_artifact) - self.app.status(msg='Build ends successfully') + self.app.status( + msg='Build of %(repo_name)s %(ref)s %(filename)s ended ' + 'successfully', + repo_name=repo_name, ref=ref, filename=filename) def new_artifact_caches(self): '''Create interfaces for the build artifact caches. |