diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-09-17 14:30:51 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-09-17 14:30:51 +0000 |
commit | a82ba097650d85b090cfcb016adc14e079b825db (patch) | |
tree | 2ab9ed2028990f5c22ad800faa838e2ada308357 | |
parent | b652fc3cb55a238293c246f2bfad2a18ade39aef (diff) | |
download | morph-sam/list-cache-keys.tar.gz |
Hack list-artifacts plugin to show cache key info instead of hashsam/list-cache-keys
Change-Id: I09ba2162656c1728fe1b6e72c379229c2006db74
-rw-r--r-- | morphlib/plugins/list_artifacts_plugin.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/morphlib/plugins/list_artifacts_plugin.py b/morphlib/plugins/list_artifacts_plugin.py index c2e6b459..d84b8871 100644 --- a/morphlib/plugins/list_artifacts_plugin.py +++ b/morphlib/plugins/list_artifacts_plugin.py @@ -19,8 +19,11 @@ from __future__ import print_function import cliapp -import morphlib +import yaml + +import sys +import morphlib class ListArtifactsPlugin(cliapp.Plugin): @@ -109,10 +112,18 @@ class ListArtifactsPlugin(cliapp.Plugin): self.app.settings, system_artifact.source.morphology['arch']) ckc = morphlib.cachekeycomputer.CacheKeyComputer(build_env) - for source in set(a.source for a in system_artifact.walk()): + cache_ids = {} + + for source in sorted(set(a.source for a in system_artifact.walk())): source.cache_key = ckc.compute_key(source) source.cache_id = ckc.get_cache_id(source) + cache_ids[source.name] = source.cache_id + + yaml.dump(cache_ids, stream=sys.stdout, default_flow_style=False) + + return [] + artifact_files = set() for artifact in system_artifact.walk(): |