ref: refs/heads/SuSE-Code-11-Branch
commit 6f74dccf40e87a854afe947e5fc68e2268fb07b8
Author: Ján Kupec
Date: Fri Jul 3 09:52:14 2009 +0200
zypper patch --with-interactive added (bnc #497711)
---
src/Zypper.cc | 23 ++++++++++++++++++++---
src/update.cc | 3 ++-
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/src/Zypper.cc b/src/Zypper.cc
index 156f8d8..0f7d9d2 100644
--- a/src/Zypper.cc
+++ b/src/Zypper.cc
@@ -1522,6 +1522,7 @@ void Zypper::processCommandOptions()
static struct option update_options[] = {
{"repo", required_argument, 0, 'r'},
{"skip-interactive", no_argument, 0, 0},
+ {"with-interactive", no_argument, 0, 0},
{"auto-agree-with-licenses", no_argument, 0, 'l'},
{"debug-solver", no_argument, 0, 0},
{"no-recommends", no_argument, 0, 0 },
@@ -1544,7 +1545,9 @@ void Zypper::processCommandOptions()
" See man zypper for more details.\n"
" --debug-solver Create solver test case for debugging.\n"
"-D, --dry-run Test the update, do not actually update.\n"
- );
+ ) + string(_(
+ " --with-interactive Do not skip interactive patches.\n"
+ ));
break;
}
@@ -3595,6 +3598,22 @@ void Zypper::doCommand()
|| copts.count("agree-to-third-party-licenses"))
_cmdopts.license_auto_agree = true;
+ bool skip_interactive = false;
+ if (copts.count("skip-interactive"))
+ {
+ if (copts.count("with-interactive"))
+ {
+ out().error(str::form(_("%s contradicts %s"), "--with-interactive", "--skip-interactive"));
+ setExitCode(ZYPPER_EXIT_ERR_INVALID_ARGS);
+ return;
+ }
+ skip_interactive = true;
+ }
+ // bnc #497711
+ else if (globalOpts().non_interactive && !copts.count("with-interactive"))
+ skip_interactive = true;
+ MIL << "Skipping interactive patches: " << (skip_interactive ? "yes" : "no") << endl;
+
ResKindSet kinds;
if (copts.count("type"))
{
@@ -3641,8 +3660,6 @@ void Zypper::doCommand()
load_resolvables(*this);
resolve(*this); // needed to compute status of PPP
- bool skip_interactive =
- copts.count("skip-interactive") || globalOpts().non_interactive;
mark_updates(*this, kinds, skip_interactive, best_effort);
diff --git a/src/update.cc b/src/update.cc
index 3093f46..edeadfb 100755
--- a/src/update.cc
+++ b/src/update.cc
@@ -578,7 +578,8 @@ mark_patch_update(const PoolItem & pi, bool skip_interactive, bool ignore_affect
&& (patch->interactive() || !patch->licenseToConfirm().empty()))
{
// Skipping a patch because it is marked as interactive or has
- // license to confirm and --skip-interactive is requested.
+ // license to confirm and --skip-interactive is requested
+ // (i.e. also --non-interactive, since it implies --skip-interactive)
Zypper::instance()->out().warning(str::form(
// translators: %s is the name of a patch
_("'%s' is interactive, skipping."), patch->name().c_str()));
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org