summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-16 19:12:23 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-16 19:12:23 +0100
commit43fe89a63bb797129452fb690fd442c78d61805b (patch)
tree1411bfdbae91e047b3f2788c45206d5fa14c77ea /morph
parent84e51a23a2ed2b9aeac03fc8f08050ecfc56ab4d (diff)
downloadmorph-43fe89a63bb797129452fb690fd442c78d61805b.tar.gz
Re-implement show-dependencies using ArtifactResolver and BuildOrder.
Diffstat (limited to 'morph')
-rwxr-xr-xmorph23
1 files changed, 14 insertions, 9 deletions
diff --git a/morph b/morph
index 36386750..ee4363d6 100755
--- a/morph
+++ b/morph
@@ -189,7 +189,6 @@ class Morph(cliapp.Application):
def cmd_show_dependencies(self, args):
'''Dumps the dependency tree of all input morphologies.'''
- graph = morphlib.buildgraph.BuildGraph()
pool = morphlib.sourcepool.SourcePool()
if not os.path.exists(self.settings['cachedir']):
@@ -226,17 +225,23 @@ class Morph(cliapp.Application):
morphology, filename)
pool.add(source)
- order = graph.compute_build_order(pool)
- self.output.write('dependency tree:\n')
- for source in sorted(pool, key=str):
- self.output.write(' %s\n' % source)
- for dependency in sorted(source.dependencies, key=str):
+ env = morphlib.buildenvironment.BuildEnvironment(self.settings)
+ computer = morphlib.cachekeycomputer.CacheKeyComputer(env)
+ resolver = morphlib.artifactresolver.ArtifactResolver(computer)
+ artifacts = resolver.resolve_artifacts(pool)
+
+ self.output.write('dependency graph:\n')
+ for artifact in sorted(artifacts, key=str):
+ self.output.write(' %s\n' % artifact)
+ for dependency in sorted(artifact.dependencies, key=str):
self.output.write(' -> %s\n' % dependency)
+
+ order = morphlib.buildorder.BuildOrder(artifacts)
self.output.write('build order:\n')
- for group in order:
+ for group in order.groups:
self.output.write(' group:\n')
- for source in group:
- self.output.write(' %s\n' % source)
+ for artifact in group:
+ self.output.write(' %s\n' % artifact)
def cmd_update_gits(self, args):
'''Update cached git repositories.