From bfa47e50c4a516a31b812c92051583e53369964a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Kupec?= Date: Fri, 3 Jul 2009 09:52:14 +0200 Subject: [PATCH] zypper patch --with-interactive added (bnc #497711) --- src/Zypper.cc | 24 +++++++++++++++++++++--- src/update.cc | 3 ++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/Zypper.cc b/src/Zypper.cc index 51b8ec5..f32bc8a 100644 --- a/src/Zypper.cc +++ b/src/Zypper.cc @@ -1570,6 +1570,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 }, @@ -1604,7 +1605,10 @@ void Zypper::processCommandOptions() "-r, --repo Load only the specified repository.\n" "-D, --dry-run Test the update, do not actually update.\n" "-d, --download-only Only download the packages, do not install.\n" - ); + //! \todo merge this with the above string for 11.3 + ) + string(_( + " --with-interactive Do not skip interactive patches.\n" + )); break; } @@ -3712,6 +3716,22 @@ void Zypper::doCommand() if (copts.count("no-confirm")) _gopts.non_interactive = 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")) { @@ -3758,8 +3778,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; if (copts.count("bugzilla") || copts.count("bz") || copts.count("cve")) mark_updates_by_issue(*this); diff --git a/src/update.cc b/src/update.cc index 2cb6201..7e84c9c 100755 --- a/src/update.cc +++ b/src/update.cc @@ -596,7 +596,8 @@ mark_patch_update(ui::Selectable & s, && (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."), -- 2.7.4