From c6b5103bf5e7cea79363311313886e27d949e39f Mon Sep 17 00:00:00 2001 From: Daniel Firth Date: Mon, 28 Oct 2013 15:24:30 +0000 Subject: Tidy up debug output of morph build --- morphlib/buildcommand.py | 6 ++++-- morphlib/plugins/branch_and_merge_plugin.py | 2 +- morphlib/stagingarea.py | 5 +---- morphlib/util.py | 11 +++++------ 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/morphlib/buildcommand.py b/morphlib/buildcommand.py index b587aa9a..cbcc39fd 100644 --- a/morphlib/buildcommand.py +++ b/morphlib/buildcommand.py @@ -395,8 +395,10 @@ class BuildCommand(object): if artifact.source.build_mode == 'bootstrap': if not self.in_same_stratum(artifact, target_artifact): continue - self.app.status(msg='Installing chunk %(chunk_name)s', - chunk_name=artifact.name) + self.app.status(msg='Installing chunk %(chunk_name)s ' + 'from cache %(cache)s', + chunk_name=artifact.name, + cache=artifact.cache_key[:7]) handle = self.lac.get(artifact) staging_area.install_artifact(handle) diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 990fe100..9961fcf3 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -1744,7 +1744,7 @@ class BranchAndMergePlugin(cliapp.Plugin): self.app.runcmd(['git', 'add'] + changed_files, cwd=repo_dir, env=env) - self.app.status(msg='%(repo)s: Update morphologies to use ' + self.app.status(msg='%(repo)s: Updating morphologies to use ' 'build branch instead of "%(branch)s"', repo=repo, branch=system_branch) diff --git a/morphlib/stagingarea.py b/morphlib/stagingarea.py index 3cd3818c..286e5374 100644 --- a/morphlib/stagingarea.py +++ b/morphlib/stagingarea.py @@ -156,9 +156,6 @@ class StagingArea(object): ''' - self._app.status(msg='Installing artifact %s' % - getattr(handle, 'name', 'unknown name')) - chunk_cache_dir = os.path.join(self._app.settings['tempdir'], 'chunks') unpacked_artifact = os.path.join( chunk_cache_dir, os.path.basename(handle.name) + '.d') @@ -296,7 +293,7 @@ class StagingArea(object): if not self.use_chroot: do_not_mount_dirs += [temp_dir] - self._app.status(msg="Not mounting dirs %r" % do_not_mount_dirs) + logging.debug("Not mounting dirs %r" % do_not_mount_dirs) real_argv = ['linux-user-chroot', '--chdir', cwd, '--unshare-net'] for d in morphlib.fsutils.invert_paths(os.walk(chroot_dir), diff --git a/morphlib/util.py b/morphlib/util.py index 53a9e283..1ccb0949 100644 --- a/morphlib/util.py +++ b/morphlib/util.py @@ -178,16 +178,15 @@ def log_dict_diff(app, cur, pre): # pragma: no cover for key in dictA.keys(): if key not in dictB: app.status(msg="New environment: %(key)s = %(value)s", - key=key, value=dictA[key], - chatty=True) + key=key, value=dictA[key], chatty=True) elif dictA[key] != dictB[key]: - app.status(msg= \ - "Environment changed: %(key)s = %(valA)s to %(key)s = %(valB)s" - % {"key": key, "valA": dictA[key], "valB": dictB[key]}) + app.status(msg="Environment changed: \ + %(key)s = %(valA)s to %(key)s = %(valB)s", + key=key, valA=dictA[key], valB=dictB[key], chatty=True) for key in dictB.keys(): if key not in dictA: app.status(msg="Environment removed: %(key)s = %(value)s", - key=key, value=dictB[key]) + key=key, value=dictB[key], chatty=True) # This acquired from rdiff-backup which is GPLv2+ and a patch from 2011 -- cgit v1.2.1