Index: smart/commands/remove.py =================================================================== --- smart/commands/remove.py (revisão 824) +++ smart/commands/remove.py (cópia de trabalho) @@ -56,6 +56,9 @@ "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")) opts, args = parser.parse_args(argv) opts.args = args return opts @@ -121,6 +124,8 @@ confirm = not opts.yes if opts.urls: ctrl.dumpTransactionURLs(trans) + elif opts.dump: + ctrl.dumpTransactionPackages(trans, removing=True) elif opts.download: ctrl.downloadTransaction(trans, confirm=confirm) elif opts.stepped: Index: smart/commands/install.py =================================================================== --- smart/commands/install.py (revisão 824) +++ smart/commands/install.py (cópia de trabalho) @@ -61,12 +61,15 @@ "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")) opts, args = parser.parse_args(argv) opts.args = args return opts def main(ctrl, opts): - + if opts.explain: sysconf.set("explain-changesets", True, soft=True) @@ -165,6 +168,8 @@ confirm = not opts.yes if opts.urls: ctrl.dumpTransactionURLs(trans) + elif opts.dump: + ctrl.dumpTransactionPackages(trans, installing=True) elif opts.download: ctrl.downloadTransaction(trans, confirm=confirm) elif opts.stepped: Index: smart/commands/upgrade.py =================================================================== --- smart/commands/upgrade.py (revisão 824) +++ smart/commands/upgrade.py (cópia de trabalho) @@ -68,6 +68,9 @@ "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")) opts, args = parser.parse_args(argv) opts.args = args return opts @@ -174,6 +177,8 @@ confirm = not opts.yes if opts.urls: ctrl.dumpTransactionURLs(trans) + elif opts.dump: + ctrl.dumpTransactionPackages(trans, upgrading=True) elif opts.download: ctrl.downloadTransaction(trans, confirm=confirm) elif opts.stepped: Index: smart/control.py =================================================================== --- smart/control.py (revisão 824) +++ smart/control.py (cópia de trabalho) @@ -414,6 +414,26 @@ for url in urls: print >>output, url + def dumpTransactionPackages(self, trans, installing=True, upgrading=False, + removing=False): + from smart.report import Report + report = Report(trans.getChangeSet()) + report.compute() + if installing: + pkgs = report.installing + elif upgrading: + pkgs = report.upgrading + elif removing: + pkgs = report.removed + items = pkgs.items() + items.sort() + pkgs = [key for key, value in items] + for pkg in pkgs: + if sysconf.get("dump-versions", True): + print >> sys.stderr, pkg + else: + print >> sys.stderr, pkg.name + def downloadURLs(self, urllst, what=None, caching=NEVER, targetdir=None): fetcher = self._fetcher fetcher.reset()