summaryrefslogtreecommitdiff
path: root/morphlib/buildcommand.py
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2013-07-03 15:08:45 +0000
committerRichard Maw <richard.maw@codethink.co.uk>2013-07-03 15:08:45 +0000
commit0807caa980f96785334ae715b510340fd94d2b5e (patch)
tree4cc67b1d7f399efb3a8c80d763dcbda74224de1b /morphlib/buildcommand.py
parent7efdaa1487bf39867d21fa19634c35e830940ca7 (diff)
downloadmorph-0807caa980f96785334ae715b510340fd94d2b5e.tar.gz
Prefix all build steps with progress and step name
This puts the information in the status prefix, so it appears every time status() is used. This also required the places where the name was manually spliced in to be removed.
Diffstat (limited to 'morphlib/buildcommand.py')
-rw-r--r--morphlib/buildcommand.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py
index 97c5ff86..cc70faf9 100644
--- a/morphlib/buildcommand.py
+++ b/morphlib/buildcommand.py
@@ -198,19 +198,23 @@ class BuildCommand(object):
old_prefix = self.app.status_prefix
for i, a in enumerate(artifacts):
self.app.status_prefix = (
- old_prefix + '[Build %d/%d] ' % ((i+1), len(artifacts)))
+ old_prefix + '[Build %(index)d/%(total)d] [%(name)s] ' % {
+ 'index': (i+1),
+ 'total': len(artifacts),
+ 'name': a.name,
+ })
- self.app.status(msg='[%(name)s] Checking if %(kind)s needs '
+ self.app.status(msg='Checking if %(kind)s needs '
'building %(sha1)s',
- name=a.name, kind=a.source.morphology['kind'],
+ kind=a.source.morphology['kind'],
sha1=a.source.sha1[:7])
if self.is_built(a):
- self.app.status(msg='[%(name)s] The %(kind)s is already built',
- name=a.name, kind=a.source.morphology['kind'])
+ self.app.status(msg='The %(kind)s is already built',
+ kind=a.source.morphology['kind'])
self.cache_artifacts_locally([a])
else:
- self.app.status(msg='[%(name)s] Building %(kind)s %(name)s',
+ self.app.status(msg='Building %(kind)s %(name)s',
name=a.name, kind=a.source.morphology['kind'])
self.build_artifact(a, build_env)
@@ -384,8 +388,7 @@ class BuildCommand(object):
if artifact.source.build_mode == 'bootstrap':
if not self.in_same_stratum(artifact, target_artifact):
continue
- self.app.status(msg='[%(name)s] Installing chunk %(chunk_name)s',
- name=target_artifact.name,
+ self.app.status(msg='Installing chunk %(chunk_name)s',
chunk_name=artifact.name)
handle = self.lac.get(artifact)
staging_area.install_artifact(handle)
@@ -396,7 +399,7 @@ class BuildCommand(object):
def build_and_cache(self, staging_area, artifact, setup_mounts):
'''Build an artifact and put it into the local artifact cache.'''
- self.app.status(msg='[%(name)s] Starting actual build: %(name)s '
+ self.app.status(msg='Starting actual build: %(name)s '
'%(sha1)s',
name=artifact.name, sha1=artifact.source.sha1[:7])
setup_mounts = self.app.settings['staging-chroot']