diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-02-19 16:58:15 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-02-19 17:17:20 +0000 |
commit | f7e888dcd8461c2ce9b642c71c2b630d2c16f542 (patch) | |
tree | bd3e2f9b25a216986d804484f227a770c847e12f /morphlib/plugins/show_dependencies_plugin.py | |
parent | 55031ffdb1e29cf5e97407dc220d9de0ee6e3707 (diff) | |
download | morph-f7e888dcd8461c2ce9b642c71c2b630d2c16f542.tar.gz |
Rewrite show-dependencies to work without BuildOrder
Diffstat (limited to 'morphlib/plugins/show_dependencies_plugin.py')
-rw-r--r-- | morphlib/plugins/show_dependencies_plugin.py | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/morphlib/plugins/show_dependencies_plugin.py b/morphlib/plugins/show_dependencies_plugin.py index 13ec512a..e4e40311 100644 --- a/morphlib/plugins/show_dependencies_plugin.py +++ b/morphlib/plugins/show_dependencies_plugin.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012 Codethink Limited +# Copyright (C) 2012-2013 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -46,27 +46,19 @@ class ShowDependenciesPlugin(cliapp.Plugin): self.app.settings['cache-server'], repo_resolver) else: rrc = None + + build_command = morphlib.buildcommand.BuildCommand(self.app) # traverse the morphs to list all the sources for repo, ref, filename in self.app.itertriplets(args): morph = filename[:-len('.morph')] - pool = self.app.create_source_pool( - lrc, rrc, (repo, ref, filename)) - - resolver = morphlib.artifactresolver.ArtifactResolver() - artifacts = resolver.resolve_artifacts(pool) - self.app.output.write('dependency graph for %s|%s|%s:\n' % (repo, ref, morph)) - for artifact in sorted(artifacts, key=str): + + artifact = build_command.get_artifact_object(repo, ref, filename) + + for artifact in reversed(artifact.walk()): self.app.output.write(' %s\n' % artifact) for dependency in sorted(artifact.dependencies, key=str): self.app.output.write(' -> %s\n' % dependency) - order = morphlib.buildorder.BuildOrder(artifacts) - self.app.output.write('build order for %s|%s|%s:\n' % - (repo, ref, morph)) - for group in order.groups: - self.app.output.write(' group:\n') - for artifact in group: - self.app.output.write(' %s\n' % artifact) |