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 | |
parent | 55031ffdb1e29cf5e97407dc220d9de0ee6e3707 (diff) | |
download | morph-f7e888dcd8461c2ce9b642c71c2b630d2c16f542.tar.gz |
Rewrite show-dependencies to work without BuildOrder
-rw-r--r-- | morphlib/plugins/show_dependencies_plugin.py | 22 | ||||
-rw-r--r-- | tests/show-dependencies.stdout | 153 |
2 files changed, 66 insertions, 109 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) diff --git a/tests/show-dependencies.stdout b/tests/show-dependencies.stdout index e58f5285..84ed3ba6 100644 --- a/tests/show-dependencies.stdout +++ b/tests/show-dependencies.stdout @@ -1,54 +1,4 @@ dependency graph for test-repo|master|xfce-core: - test-repo|master|cairo|cairo - test-repo|master|dbus-glib|dbus-glib - -> test-repo|master|dbus|dbus - -> test-repo|master|glib|glib - test-repo|master|dbus|dbus - test-repo|master|exo|exo - -> test-repo|master|gtk-stack|gtk-stack - -> test-repo|master|libxfce4util|libxfce4util - test-repo|master|fontconfig|fontconfig - test-repo|master|freetype|freetype - test-repo|master|garcon|garcon - -> test-repo|master|gtk-stack|gtk-stack - -> test-repo|master|libxfce4util|libxfce4util - test-repo|master|gdk-pixbuf|gdk-pixbuf - -> test-repo|master|glib|glib - test-repo|master|glib|glib - test-repo|master|gtk-stack|gtk-stack - -> test-repo|master|cairo|cairo - -> test-repo|master|dbus-glib|dbus-glib - -> test-repo|master|dbus|dbus - -> test-repo|master|fontconfig|fontconfig - -> test-repo|master|freetype|freetype - -> test-repo|master|gdk-pixbuf|gdk-pixbuf - -> test-repo|master|glib|glib - -> test-repo|master|gtk|gtk - -> test-repo|master|pango|pango - test-repo|master|gtk-xfce-engine|gtk-xfce-engine - -> test-repo|master|garcon|garcon - -> test-repo|master|gtk-stack|gtk-stack - -> test-repo|master|libxfce4ui|libxfce4ui - -> test-repo|master|xfconf|xfconf - test-repo|master|gtk|gtk - -> test-repo|master|cairo|cairo - -> test-repo|master|gdk-pixbuf|gdk-pixbuf - -> test-repo|master|glib|glib - -> test-repo|master|pango|pango - test-repo|master|libxfce4ui|libxfce4ui - -> test-repo|master|gtk-stack|gtk-stack - -> test-repo|master|xfconf|xfconf - test-repo|master|libxfce4util|libxfce4util - -> test-repo|master|gtk-stack|gtk-stack - test-repo|master|pango|pango - -> test-repo|master|fontconfig|fontconfig - -> test-repo|master|freetype|freetype - test-repo|master|thunar|thunar - -> test-repo|master|exo|exo - -> test-repo|master|gtk-stack|gtk-stack - -> test-repo|master|libxfce4ui|libxfce4ui - test-repo|master|tumbler|tumbler - -> test-repo|master|gtk-stack|gtk-stack test-repo|master|xfce-core|xfce-core -> test-repo|master|exo|exo -> test-repo|master|garcon|garcon @@ -65,16 +15,24 @@ dependency graph for test-repo|master|xfce-core: -> test-repo|master|xfconf|xfconf -> test-repo|master|xfdesktop|xfdesktop -> test-repo|master|xfwm4|xfwm4 - test-repo|master|xfce4-appfinder|xfce4-appfinder + test-repo|master|gtk-xfce-engine|gtk-xfce-engine -> test-repo|master|garcon|garcon -> test-repo|master|gtk-stack|gtk-stack -> test-repo|master|libxfce4ui|libxfce4ui -> test-repo|master|xfconf|xfconf - test-repo|master|xfce4-panel|xfce4-panel - -> test-repo|master|exo|exo + test-repo|master|xfce4-appfinder|xfce4-appfinder -> test-repo|master|garcon|garcon -> test-repo|master|gtk-stack|gtk-stack -> test-repo|master|libxfce4ui|libxfce4ui + -> test-repo|master|xfconf|xfconf + test-repo|master|xfdesktop|xfdesktop + -> test-repo|master|gtk-stack|gtk-stack + -> test-repo|master|libxfce4ui|libxfce4ui + -> test-repo|master|xfconf|xfconf + test-repo|master|xfwm4|xfwm4 + -> test-repo|master|gtk-stack|gtk-stack + -> test-repo|master|libxfce4ui|libxfce4ui + -> test-repo|master|xfconf|xfconf test-repo|master|xfce4-session|xfce4-session -> test-repo|master|exo|exo -> test-repo|master|gtk-stack|gtk-stack @@ -85,49 +43,56 @@ dependency graph for test-repo|master|xfce-core: -> test-repo|master|gtk-stack|gtk-stack -> test-repo|master|libxfce4ui|libxfce4ui -> test-repo|master|xfconf|xfconf - test-repo|master|xfconf|xfconf - -> test-repo|master|gtk-stack|gtk-stack - -> test-repo|master|libxfce4util|libxfce4util - test-repo|master|xfdesktop|xfdesktop + test-repo|master|xfce4-panel|xfce4-panel + -> test-repo|master|exo|exo + -> test-repo|master|garcon|garcon -> test-repo|master|gtk-stack|gtk-stack -> test-repo|master|libxfce4ui|libxfce4ui - -> test-repo|master|xfconf|xfconf - test-repo|master|xfwm4|xfwm4 + test-repo|master|tumbler|tumbler + -> test-repo|master|gtk-stack|gtk-stack + test-repo|master|thunar|thunar + -> test-repo|master|exo|exo -> test-repo|master|gtk-stack|gtk-stack -> test-repo|master|libxfce4ui|libxfce4ui + test-repo|master|garcon|garcon + -> test-repo|master|gtk-stack|gtk-stack + -> test-repo|master|libxfce4util|libxfce4util + test-repo|master|exo|exo + -> test-repo|master|gtk-stack|gtk-stack + -> test-repo|master|libxfce4util|libxfce4util + test-repo|master|libxfce4ui|libxfce4ui + -> test-repo|master|gtk-stack|gtk-stack -> test-repo|master|xfconf|xfconf -build order for test-repo|master|xfce-core: - group: - test-repo|master|glib|glib - test-repo|master|freetype|freetype - test-repo|master|fontconfig|fontconfig - group: - test-repo|master|cairo|cairo - test-repo|master|gdk-pixbuf|gdk-pixbuf - test-repo|master|pango|pango - test-repo|master|dbus|dbus - group: - test-repo|master|gtk|gtk - test-repo|master|dbus-glib|dbus-glib - group: - test-repo|master|gtk-stack|gtk-stack - group: - test-repo|master|libxfce4util|libxfce4util - group: - test-repo|master|xfconf|xfconf - group: - test-repo|master|exo|exo - test-repo|master|libxfce4ui|libxfce4ui - test-repo|master|garcon|garcon - group: - test-repo|master|thunar|thunar - test-repo|master|tumbler|tumbler - test-repo|master|xfce4-panel|xfce4-panel - test-repo|master|xfce4-settings|xfce4-settings - test-repo|master|xfce4-session|xfce4-session - test-repo|master|xfwm4|xfwm4 - test-repo|master|xfdesktop|xfdesktop - test-repo|master|xfce4-appfinder|xfce4-appfinder - test-repo|master|gtk-xfce-engine|gtk-xfce-engine - group: - test-repo|master|xfce-core|xfce-core + test-repo|master|xfconf|xfconf + -> test-repo|master|gtk-stack|gtk-stack + -> test-repo|master|libxfce4util|libxfce4util + test-repo|master|libxfce4util|libxfce4util + -> test-repo|master|gtk-stack|gtk-stack + test-repo|master|gtk-stack|gtk-stack + -> test-repo|master|cairo|cairo + -> test-repo|master|dbus-glib|dbus-glib + -> test-repo|master|dbus|dbus + -> test-repo|master|fontconfig|fontconfig + -> test-repo|master|freetype|freetype + -> test-repo|master|gdk-pixbuf|gdk-pixbuf + -> test-repo|master|glib|glib + -> test-repo|master|gtk|gtk + -> test-repo|master|pango|pango + test-repo|master|dbus-glib|dbus-glib + -> test-repo|master|dbus|dbus + -> test-repo|master|glib|glib + test-repo|master|dbus|dbus + test-repo|master|gtk|gtk + -> test-repo|master|cairo|cairo + -> test-repo|master|gdk-pixbuf|gdk-pixbuf + -> test-repo|master|glib|glib + -> test-repo|master|pango|pango + test-repo|master|gdk-pixbuf|gdk-pixbuf + -> test-repo|master|glib|glib + test-repo|master|glib|glib + test-repo|master|pango|pango + -> test-repo|master|fontconfig|fontconfig + -> test-repo|master|freetype|freetype + test-repo|master|cairo|cairo + test-repo|master|fontconfig|fontconfig + test-repo|master|freetype|freetype |