ref: refs/heads/SuSE-Code-11-Branch
commit 360a7538073c551b80299598b3c0f5ef32872163
Author: Ján Kupec
Date: Tue Feb 10 18:36:51 2009 +0100
Non-interactive mode fix (bnc #469872)
Auto-reply 'retry' after waiting the given amount of seconds in the
read_action_ari_with_timeout() prompt in non-interactive mode. This
does not fix the cause of bnc #469872, but is a simple workaround
which does not poll input, just waits.
---
src/utils/prompt.cc | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/utils/prompt.cc b/src/utils/prompt.cc
index c2c210a..45068ca 100644
--- a/src/utils/prompt.cc
+++ b/src/utils/prompt.cc
@@ -89,6 +89,7 @@ const std::string ari_mapping[] = { string(_("abort")),string(_("retry")),string
int read_action_ari_with_timeout (PromptId pid, unsigned timeout,
int default_action) {
+ Zypper & zypper = *Zypper::instance();
Out & out = Zypper::instance()->out();
if (default_action >2 || default_action < 0)
@@ -97,6 +98,15 @@ int read_action_ari_with_timeout (PromptId pid, unsigned timeout,
default_action = 0;
}
+ // wait 'timeout' number of seconds and return the default in non-interactive mode
+ if (zypper.globalOpts().non_interactive)
+ {
+ zypper.out().info(zypp::str::form(_("Retrying in %u seconds..."), timeout));
+ sleep(timeout);
+ MIL << "running non-interactively, returning " << default_action << endl;
+ return default_action;
+ }
+
out.info (_("Abort, retry, ignore?\n"));
//FIXME XML output
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org