* for caglar: if no args given graph all installed packages

This commit is contained in:
Eray Özkural
2005-11-03 23:06:58 +00:00
parent 4c40bcc361
commit 99faaa356a
+8 -3
View File
@@ -254,7 +254,7 @@ class DeleteCache(Command):
class Graph(Command):
"""Graph package relations.
Usage: graph <package1> <package2> ...
Usage: graph [<package1> <package2> ...]
Write a graph of package relations, tracking dependency and
conflicts relations starting from given packages.
@@ -270,8 +270,13 @@ conflicts relations starting from given packages.
def run(self):
self.init()
if self.args:
g = pisi.api.package_graph(self.args)
g.write_graphviz(file('pgraph.dot', 'w'))
a = self.args
else:
# if A is empty, then graph all packages
ctx.ui.info(_('Plotting a graph of relations among all packages'))
a = ctx.installdb.list_installed()
g = pisi.api.package_graph(a)
g.write_graphviz(file('pgraph.dot', 'w'))
self.finalize()
# option mixins