Author: jkupec
Date: Wed Jan 16 17:58:02 2008
New Revision: 8306
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8306&view=rev
Log:
- --dry-run for in, rm, up, and dup (#350736)
Modified:
trunk/zypper/src/zypper-misc.cc
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=8306&r1=8305&r2=8306&view=diff
==============================================================================
--- trunk/zypper/src/zypper-misc.cc (original)
+++ trunk/zypper/src/zypper-misc.cc Wed Jan 16 17:58:02 2008
@@ -1505,16 +1505,30 @@
if (!confirm_licenses(zypper)) return;
- cerr_v << _("committing") << endl;
- MIL << "committing..." << endl;
-
try {
//! \todo fix the media reporting correctly
gData.show_media_progress_hack = true;
- ZYppCommitResult result = God->commit(
+ cerr_v << _("committing"); MIL << "committing...";
+
+ ZYppCommitResult result;
+ if (copts.count("dry-run"))
+ {
+ cerr_v << " " << _("(dry run)") << endl; MIL << "(dry run)";
+
+ result = God->commit(ZYppCommitPolicy().dryRun(true));
+ }
+ else
+ {
+ cerr_v << endl; // endl after 'committing'
+
+ result = God->commit(
ZYppCommitPolicy().syncPoolAfterCommit(zypper.runningShell()));
- was_installed = true;
+
+ was_installed = true;
+ }
+
+ MIL << endl << "DONE" << endl;
gData.show_media_progress_hack = false;
Modified: trunk/zypper/src/zypper.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper.cc?rev=8306&r1=8305&r2=8306&view=diff
==============================================================================
--- trunk/zypper/src/zypper.cc (original)
+++ trunk/zypper/src/zypper.cc Wed Jan 16 17:58:02 2008
@@ -666,6 +666,7 @@
{"agree-to-third-party-licenses", no_argument, 0, 0},
{"debug-solver", no_argument, 0, 0},
{"force-resolution", required_argument, 0, 'R'},
+ {"dry-run", no_argument, 0, 'd'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
@@ -690,6 +691,7 @@
" See 'man zypper' for more details.\n"
" --debug-solver Create solver test case for debugging\n"
"-R, --force-resolution