Index: smart/commands/remove.py
===================================================================
--- smart/commands/remove.py	(revisão 746)
+++ smart/commands/remove.py	(cópia de trabalho)
@@ -56,6 +56,14 @@
                              "when possible"))
     parser.add_option("-y", "--yes", action="store_true",
                       help=_("do not ask for confirmation"))
+    parser.add_option("--dump", action="store_true",
+                      help=_("dump package names and versions to stderr but "
+                             "don't commit operation"))
+    parser.add_option("--dump-noversion", action="store_true",
+                      help=_("dump package names without versions to stderr but "
+                             "don't commit operation"))
+    parser.add_option("--dump-tofile", metavar=_("FILE"),
+                      help=_("dump packages in transaction to a file"))
     opts, args = parser.parse_args(argv)
     opts.args = args
     return opts
@@ -121,6 +129,10 @@
         confirm = not opts.yes
         if opts.urls:
             ctrl.dumpTransactionURLs(trans)
+        elif opts.dump:
+            ctrl.dumpTransactionPackages(trans, "remove", noversion=False, file=opts.dump_tofile)
+        elif opts.dump_noversion:
+            ctrl.dumpTransactionPackages(trans, "remove", noversion=True, file=opts.dump_tofile)
         elif opts.download:
             ctrl.downloadTransaction(trans, confirm=confirm)
         elif opts.stepped:
Index: smart/commands/install.py
===================================================================
--- smart/commands/install.py	(revisão 746)
+++ smart/commands/install.py	(cópia de trabalho)
@@ -61,11 +61,23 @@
                              "when possible"))
     parser.add_option("-y", "--yes", action="store_true",
                       help=_("do not ask for confirmation"))
+    parser.add_option("--dump", action="store_true",
+                      help=_("dump package names and versions to stderr but "
+                             "don't commit operation"))
+    parser.add_option("--dump-noversion", action="store_true",
+                      help=_("dump package names without versions to stderr but "
+                             "don't commit operation"))
+    parser.add_option("--dump-tofile", metavar=_("FILE"),
+                      help=_("dump packages in transaction to a file"))
     opts, args = parser.parse_args(argv)
     opts.args = args
     return opts
 
 def main(ctrl, opts):
+ 
+    if opts.dump_tofile and not (opts.dump or opts.dump_noversion):
+        raise Error, _("Option 'dump-tofile' must be used with 'dump'"
+                       "or 'dump-noversion'.")
 
     if opts.explain:
         sysconf.set("explain-changesets", True, soft=True)
@@ -165,6 +177,10 @@
         confirm = not opts.yes
         if opts.urls:
             ctrl.dumpTransactionURLs(trans)
+        elif opts.dump:
+            ctrl.dumpTransactionPackages(trans, "install", noversion=False, file=opts.dump_tofile)
+        elif opts.dump_noversion:
+            ctrl.dumpTransactionPackages(trans, "install", noversion=True, file=opts.dump_tofile)
         elif opts.download:
             ctrl.downloadTransaction(trans, confirm=confirm)
         elif opts.stepped:
Index: smart/commands/upgrade.py
===================================================================
--- smart/commands/upgrade.py	(revisão 746)
+++ smart/commands/upgrade.py	(cópia de trabalho)
@@ -68,6 +68,14 @@
                              "when possible"))
     parser.add_option("-y", "--yes", action="store_true",
                       help=_("do not ask for confirmation"))
+    parser.add_option("--dump", action="store_true",
+                      help=_("dump package names and versions to stderr but "
+                             "don't commit operation"))
+    parser.add_option("--dump-noversion", action="store_true",
+                      help=_("dump package names without versions to stderr but "
+                             "don't commit operation"))
+    parser.add_option("--dump-tofile", metavar=_("FILE"),
+                      help=_("dump packages in transaction to a file"))
     opts, args = parser.parse_args(argv)
     opts.args = args
     return opts
@@ -174,6 +182,10 @@
         confirm = not opts.yes
         if opts.urls:
             ctrl.dumpTransactionURLs(trans)
+        elif opts.dump:
+            ctrl.dumpTransactionPackages(trans, "upgrade", noversion=False, file=opts.dump_tofile)
+        elif opts.dump_noversion:
+            ctrl.dumpTransactionPackages(trans, "upgrade", noversion=True, file=opts.dump_tofile)
         elif opts.download:
             ctrl.downloadTransaction(trans, confirm=confirm)
         elif opts.stepped:
Index: smart/control.py
===================================================================
--- smart/control.py	(revisão 746)
+++ smart/control.py	(cópia de trabalho)
@@ -414,6 +414,31 @@
         for url in urls:
             print >>output, url
 
+    def dumpTransactionPackages(self, trans, action="install", noversion=False, file=""):
+        print
+        from smart.report import Report
+        report = Report(trans.getChangeSet())
+        report.compute()
+        if action == "install":
+            pkgs = report.installing
+        elif action == "upgrade":
+            pkgs = report.upgrading
+        elif action == "remove":
+            pkgs = report.removed
+        items = pkgs.items()
+        items.sort()
+        pkgs = [key for key, value in items]
+        if file:
+            output = open(file, 'w')
+        else:
+            output = sys.stderr
+        for pkg in pkgs:
+            if noversion:
+                print >>output, pkg.name
+            else:
+                print >>output, pkg
+        if file:output.close()
+
     def downloadURLs(self, urllst, what=None, caching=NEVER, targetdir=None):
         fetcher = self._fetcher
         fetcher.reset()
