Author: jkupec
Date: Thu Feb 21 14:00:15 2008
New Revision: 8846
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8846&view=rev
Log:
- prompts -> Out::prompt()
- TODO: localization of some prompts
Added:
trunk/zypper/src/output/prompt.h
Modified:
trunk/zypper/src/AliveCursor.h
trunk/zypper/src/CMakeLists.txt
trunk/zypper/src/output/Out.h
trunk/zypper/src/output/OutNormal.cc
trunk/zypper/src/output/OutNormal.h
trunk/zypper/src/output/OutXML.cc
trunk/zypper/src/output/OutXML.h
trunk/zypper/src/output/xmlout.rnc
trunk/zypper/src/zypper-callbacks.cc
trunk/zypper/src/zypper-callbacks.h
trunk/zypper/src/zypper-keyring-callbacks.h
trunk/zypper/src/zypper-media-callbacks.h
trunk/zypper/src/zypper-misc.cc
trunk/zypper/src/zypper-repo-callbacks.h
trunk/zypper/src/zypper-rpm-callbacks.h
Modified: trunk/zypper/src/AliveCursor.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/AliveCursor.h?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/AliveCursor.h (original)
+++ trunk/zypper/src/AliveCursor.h Thu Feb 21 14:00:15 2008
@@ -6,6 +6,7 @@
// VT 100
#define CLEARLN "\x1B[2K\r"
+#define CURSORUP(N) "\x1B["#N"A"
class AliveCursor
{
Modified: trunk/zypper/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/CMakeLists.txt?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/CMakeLists.txt (original)
+++ trunk/zypper/src/CMakeLists.txt Thu Feb 21 14:00:15 2008
@@ -42,6 +42,7 @@
output/Out.h
output/OutNormal.h
output/OutXML.h
+ output/prompt.h
)
SET( zypper_out_SRCS
Modified: trunk/zypper/src/output/Out.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/Out.h?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/output/Out.h (original)
+++ trunk/zypper/src/output/Out.h Thu Feb 21 14:00:15 2008
@@ -7,6 +7,8 @@
#include "zypp/base/Exception.h"
#include "zypp/Url.h"
+#include "prompt.h"
+
/**
*
* - Logger (DBG, MIL, ...) must be in place
@@ -105,7 +107,9 @@
int rate = -1) = 0;
virtual void dwnldProgressEnd(const zypp::Url & uri) = 0;
- //virtual void Prompt() = 0;
+ virtual void prompt(PromptId id,
+ const std::string & prompt,
+ const std::string & answer_hint) = 0;
public:
/** Get current verbosity. */
Verbosity verbosity() { return _verbosity; }
Modified: trunk/zypper/src/output/OutNormal.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutNormal.cc?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/output/OutNormal.cc (original)
+++ trunk/zypper/src/output/OutNormal.cc Thu Feb 21 14:00:15 2008
@@ -181,3 +181,13 @@
cout << " [" << _("done") << "]";
cout << endl << std::flush;
}
+
+void OutNormal::prompt(PromptId id,
+ const string & prompt,
+ const string & answer_hint)
+{
+ cout << CLEARLN << prompt;
+ if (!answer_hint.empty())
+ cout << " " << answer_hint;
+ cout << ": " << std::flush;
+}
Modified: trunk/zypper/src/output/OutNormal.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutNormal.h?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/output/OutNormal.h (original)
+++ trunk/zypper/src/output/OutNormal.h Thu Feb 21 14:00:15 2008
@@ -32,6 +32,10 @@
int value = -1,
int rate = -1);
virtual void dwnldProgressEnd(const zypp::Url & uri);
+
+ virtual void prompt(PromptId id,
+ const std::string & prompt,
+ const std::string & answer_hint);
protected:
virtual bool mine(Type type);
Modified: trunk/zypper/src/output/OutXML.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutXML.cc?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/output/OutXML.cc (original)
+++ trunk/zypper/src/output/OutXML.cc Thu Feb 21 14:00:15 2008
@@ -131,3 +131,10 @@
{
cout << "" << endl;
}
+
+void OutXML::prompt(PromptId id,
+ const string & prompt,
+ const string & answer_hint) // hint ignored for now, maybe an enumeration will be here in the future
+{
+ cout << "" << prompt << "</prompt>" << endl;
+}
Modified: trunk/zypper/src/output/OutXML.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutXML.h?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/output/OutXML.h (original)
+++ trunk/zypper/src/output/OutXML.h Thu Feb 21 14:00:15 2008
@@ -33,6 +33,10 @@
int rate = -1);
virtual void dwnldProgressEnd(const zypp::Url & uri);
+ virtual void prompt(PromptId id,
+ const std::string & prompt,
+ const std::string & answer_hint);
+
protected:
virtual bool mine(Type type);
Added: trunk/zypper/src/output/prompt.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/prompt.h?rev=8846&view=auto
==============================================================================
--- trunk/zypper/src/output/prompt.h (added)
+++ trunk/zypper/src/output/prompt.h Thu Feb 21 14:00:15 2008
@@ -0,0 +1,48 @@
+#ifndef PROMPT_H_
+#define PROMPT_H_
+
+/**
+ * Defines identifiers of zypper's user prompts. Used in machine-readable output
+ * for easy and unique identification of the prompts by a machine.
+ *
+ * <table>
+ * <tr>
+ * <td>Id</td>
+ * <td>#</td>
+ * <td>Prompt</td>
+ * <td>Description</td>
+ * <td>answers</td>
+ * </tr>
+ * <tr>
+ * <td>PROMPT_YN_INST_REMOVE_CONTINUE</td>
+ * <td>0</td>
+ * <td>Proceed with the installation/removal/update? Displayed right after the install summary.</td>
+ * <td>y/n or stdlib localized answers (rpmatch)</td>
+ * </tr>
+ * </table>
+ * \todo add the description of the rest
+ */
+typedef enum
+{
+ PROMPT_YN_INST_REMOVE_CONTINUE = 0,
+ PROMPT_DEP_RESOLVE = 1,
+ PROMPT_AUTH_USERNAME = 2,
+ PROMPT_AUTH_PASSWORD = 3,
+ PROMPT_ARI_RPM_DOWNLOAD_PROBLEM = 4,
+ PROMPT_ARI_REPO_PROBLEM = 5,
+ PROMPT_ARI_RPM_REMOVE_PROBLEM = 6,
+ PROMPT_ARI_RPM_INSTALL_PROBLEM = 7,
+ PROMPT_ARI_MEDIA_PROBLEM = 8,
+ PROMPT_YN_MEDIA_CHANGE = 9,
+ PROMPT_YN_LICENSE_AGREE = 10,
+ PROMPT_YN_GPG_UNSIGNED_FILE_ACCEPT = 11,
+ PROMPT_YN_GPG_KEY_IMPORT_TRUSTED = 12,
+ PROMPT_YN_GPG_UNKNOWN_KEY_ACCEPT = 13,
+ PROMPT_YN_GPG_KEY_TRUST = 14,
+ PROMPT_YN_GPG_CHECK_FAILED_IGNORE = 15,
+ PROMPT_GPG_NO_DIGEST_ACCEPT = 16,
+ PROMPT_GPG_UNKNOWN_DIGEST_ACCEPT = 17,
+ PROMPT_GPG_WRONG_DIGEST_ACCEPT = 18
+} PromptId;
+
+#endif /*PROMPT_H_*/
Modified: trunk/zypper/src/output/xmlout.rnc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/xmlout.rnc?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/output/xmlout.rnc (original)
+++ trunk/zypper/src/output/xmlout.rnc Thu Feb 21 14:00:15 2008
@@ -11,44 +11,65 @@
stream-element =
element stream {
- ( update-element | progress-element | message-element )+
+ ( progress-elements | download-progress-elements | message-element | prompt-element |
+ update-element )+
}
-progress-element = ( progress-tick | progress-percentage )
+progress-elements = ( progress-alive | progress-percentage | progress-done )
-progress-tick =
+# todo - restrict and specialize progress by type
+progress-percentage =
element progress {
attribute id { xsd:string },
- attribute type { "tick" },
- attribute name { xsd:string }?,
- element tick { empty }*
+ attribute name { xsd:string },
+ attribute type { "percentage" },
+ attribute value { xsd:integer }
}
-progress-percentage =
+progress-alive =
element progress {
attribute id { xsd:string },
- attribute type { "percentage" },
- attribute name { xsd:string }?,
- element tick {
- attribute value { xsd:integer }
- }*
+ attribute name { xsd:string },
+ attribute type { "alive" },
}
-# old
-#progress-element =
-# element progress {
-# attribute id { xsd:string },
-# attribute type { xsd:string },
-# attribute value { xsd:integer },
-# attribute name { xsd:string }
-# }
+progress-done =
+ element progress {
+ attribute id { xsd:string },
+ attribute name { xsd:string },
+ attribute done { xsd:boolean },
+ }
-update-element =
- element update { empty }
+download-progress-elements = ( download-progress-element | download-progress-done )
+
+download-progress-element =
+ element download {
+ attribute id { xsd:string },
+ attribute label { xsd:string },
+ attribute percent { xsd:integer },
+ attribute rate { xsd:integer } # download rate in bytes per second
+# attribute done { xsd:boolean },
+ }
+
+download-progress-done =
+ element download {
+ attribute id { xsd:string },
+ attribute label { xsd:string },
+ attribute done { xsd:boolean },
+ }
message-element =
element message {
attribute id { xsd:string }
attribute type { "info" | "warning" | "error" },
text
- }
\ No newline at end of file
+ }
+
+prompt-element =
+ element prompt {
+ attribute id { xsd:integer },
+ text
+ }
+
+update-element =
+ element update { empty }
Modified: trunk/zypper/src/zypper-callbacks.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-callbacks.cc?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/zypper-callbacks.cc (original)
+++ trunk/zypper/src/zypper-callbacks.cc Thu Feb 21 14:00:15 2008
@@ -10,6 +10,7 @@
#include "AliveCursor.h"
#include "zypper.h"
#include "zypper-main.h"
+#include "output/Out.h"
using namespace std;
using namespace boost;
@@ -83,9 +84,9 @@
//template<typename Action>
//Action ...
-int read_action_ari (int default_action) {
- // TranslatorExplanation don't translate letters in parentheses!! (yet)
- cout << _("(A)bort, (R)etry, (I)gnore?") << " ";
+int read_action_ari (PromptId pid, int default_action) {
+ Out & out = Zypper::instance()->out();
+ out.prompt(pid, _("Abort, retry, ignore?"), "[a/r/i]"); //! \todo translation?
// choose abort if no default has been specified
if (default_action == -1) {
@@ -101,8 +102,8 @@
case 2: c = 'i'; break;
default: c = '?';
}
- // print the answer for conveniecne
- cout << c << endl;
+ // print the answer for conveniecne (only for normal output)
+ out.info(string(1, c), Out::QUIET, Out::TYPE_NORMAL);
MIL << "answer: " << c << endl;
return default_action;
}
@@ -119,7 +120,10 @@
return 1;
else if (c == 'i')
return 2;
- cerr << _("Invalid answer. Choose letter a, r, or i.") << endl;
+ // translators: don't translate the letters
+ out.prompt(pid,
+ boost::str(format(_("Invalid answer '%s'.")) % c),
+ _("Choose letter 'a', 'r', or 'i'"));
DBG << "invalid answer" << endl;
}
@@ -128,19 +132,21 @@
// ----------------------------------------------------------------------------
-bool read_bool_answer(const string & question, bool default_answer)
+bool read_bool_answer(PromptId pid, const string & question, bool default_answer)
{
const GlobalOptions & gopts = Zypper::instance()->globalOpts();
- if (!gopts.machine_readable)
- cout << CLEARLN << question
- << " [" << _("yes") << "/" << _("no") << "]: "
- << flush;
+ Out & out = Zypper::instance()->out();
- // non-interactive mode: print the answer for convenience and return default
+ ostringstream s;
+ s << "[" << _("yes") << "/" << _("no") << "]";
+ out.prompt(pid, question, s.str());
+
+ // non-interactive mode: print the answer for convenience (only for normal
+ // output) and return default
if (gopts.non_interactive)
{
if (!gopts.machine_readable)
- cout << (default_answer ? _("yes") : _("no")) << endl;
+ out.info((default_answer ? _("yes") : _("no")), Out::QUIET, Out::TYPE_NORMAL);
MIL << "answer (default): " << (default_answer ? 'y' : 'n') << endl;
return default_answer;
}
@@ -152,11 +158,13 @@
while (stm.good() && rpmatch(c.c_str()) == -1)
{
if (been_here_before)
- cerr << format(
+ out.prompt(pid,
+ boost::str(format(_("Invalid answer '%s'.")) % c),
+ boost::str(format(
// TranslatorExplanation don't translate the 'y' and 'n', they can always be used as answers.
// The second and the third %s is the translated 'yes' and 'no' string (lowercase).
- _("Invalid answer '%s'. Enter 'y' for '%s' or 'n' for '%s' if nothing else works for you"))
- % c % _("yes") % _("no") << ": ";
+ _("Enter 'y' for '%s' or 'n' for '%s' if nothing else works for you"))
+ % _("yes") % _("no")));
c = zypp::str::getline (stm, zypp::str::TRIM);
been_here_before = true;
}
Modified: trunk/zypper/src/zypper-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-callbacks.h?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/zypper-callbacks.h (original)
+++ trunk/zypper/src/zypper-callbacks.h Thu Feb 21 14:00:15 2008
@@ -61,7 +61,7 @@
* is specified, 0 (ABORT) is returned. In interactive mode, this parameter
* is ignored.
*/
-int read_action_ari (int default_action = -1);
+int read_action_ari (PromptId pid, int default_action = -1);
/**
* Prompt for y/n answer (localized) from stdin.
@@ -70,7 +70,7 @@
* \param default_answer Value to be returned in non-interactive mode or on
* input failure.
*/
-bool read_bool_answer(const std::string & question, bool default_answer);
+bool read_bool_answer(PromptId pid, const std::string & question, bool default_answer);
/**
* Returns string representation of a resolvable.
Modified: trunk/zypper/src/zypper-keyring-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-keyring-callbacks.h?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/zypper-keyring-callbacks.h (original)
+++ trunk/zypper/src/zypper-keyring-callbacks.h Thu Feb 21 14:00:15 2008
@@ -20,7 +20,6 @@
#include "zypp/KeyRing.h"
#include "zypp/Digest.h"
-#include "AliveCursor.h"
#include "zypper-callbacks.h"
///////////////////////////////////////////////////////////////////
@@ -46,7 +45,7 @@
// TranslatorExplanation: speaking of a file
std::string question = boost::str(boost::format(
_("%s is unsigned, continue?")) % file);
- return read_bool_answer(question, false);
+ return read_bool_answer(PROMPT_YN_GPG_UNSIGNED_FILE_ACCEPT, question, false);
}
virtual bool askUserToImportKey( const PublicKey &key )
@@ -56,7 +55,7 @@
std::string question = boost::str(boost::format(
_("Import key %s to trusted keyring?")) % key.id());
- return read_bool_answer(question, false);
+ return read_bool_answer(PROMPT_YN_GPG_KEY_IMPORT_TRUSTED, question, false);
}
virtual bool askUserToAcceptUnknownKey( const std::string &file, const std::string &id )
@@ -73,7 +72,7 @@
// TranslatorExplanation: speaking of a file
std::string question = boost::str(boost::format(
_("%s is signed with an unknown key %s. Continue?")) % file % id);
- return read_bool_answer(question, false);
+ return read_bool_answer(PROMPT_YN_GPG_UNKNOWN_KEY_ACCEPT, question, false);
}
virtual bool askUserToTrustKey( const PublicKey &key )
@@ -94,7 +93,7 @@
std::string question = boost::str(boost::format(
_("Do you want to trust key id %s, %s, fingerprint %s"))
% keyid % keyname % fingerprint);
- return read_bool_answer(question, false);
+ return read_bool_answer(PROMPT_YN_GPG_KEY_TRUST, question, false);
}
virtual bool askUserToAcceptVerificationFailed( const std::string &file,const PublicKey &key )
@@ -126,7 +125,7 @@
string("\n") +
_("Continuing is risky! Continue anyway?"))
% file % keyid % keyname % fingerprint);
- return read_bool_answer(question, false);
+ return read_bool_answer(PROMPT_YN_GPG_CHECK_FAILED_IGNORE, question, false);
}
private:
@@ -141,7 +140,7 @@
{
std::string question = boost::str(boost::format(
_("No digest for file %s.")) % file) + " " + _("Continue?");
- return read_bool_answer(question, _gopts.no_gpg_checks);
+ return read_bool_answer(PROMPT_GPG_NO_DIGEST_ACCEPT, question, _gopts.no_gpg_checks);
}
virtual bool askUserToAccepUnknownDigest( const Pathname &file, const std::string &name )
@@ -149,7 +148,7 @@
std::string question = boost::str(boost::format(
_("Unknown digest %s for file %s.")) %name % file) + " " +
_("Continue?");
- return read_bool_answer(question, _gopts.no_gpg_checks);
+ return read_bool_answer(PROMPT_GPG_UNKNOWN_DIGEST_ACCEPT, question, _gopts.no_gpg_checks);
}
virtual bool askUserToAcceptWrongDigest( const Pathname &file, const std::string &requested, const std::string &found )
@@ -168,7 +167,7 @@
std::string question = boost::str(boost::format(
_("Digest verification failed for %s. Expected %s, found %s."))
% file.basename() % requested % found) + " " + _("Continue?");
- return read_bool_answer(question, false);
+ return read_bool_answer(PROMPT_GPG_WRONG_DIGEST_ACCEPT, question, false);
}
private:
Modified: trunk/zypper/src/zypper-media-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-media-callbacks.h?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/zypper-media-callbacks.h (original)
+++ trunk/zypper/src/zypper-media-callbacks.h Thu Feb 21 14:00:15 2008
@@ -26,8 +26,8 @@
#include "zypper.h"
#include "zypper-callbacks.h"
-#include "AliveCursor.h"
#include "zypper-utils.h"
+#include "output/prompt.h"
using zypp::media::MediaChangeReport;
using zypp::media::DownloadProgressReport;
@@ -56,7 +56,7 @@
// /usr/lib/locale//LC_MESSAGES/SYS_LC_MESSAGES
_("Please insert medium [%s] #%d and type 'y' to continue or 'n' to cancel the operation."))
% gData.current_repo.name() % mediumNr);
- if (read_bool_answer(request, false))
+ if (read_bool_answer(PROMPT_YN_MEDIA_CHANGE, request, false))
return MediaChangeReport::RETRY;
else
return MediaChangeReport::ABORT;
@@ -105,7 +105,7 @@
display_done ("download", cout_v);
}
display_error (error, description);
- return DownloadProgressReport::ABORT;
+ return (Action) read_action_ari(PROMPT_ARI_MEDIA_PROBLEM, DownloadProgressReport::ABORT);
}
// used only to finish, errors will be reported in media change callback (libzypp 3.20.0)
@@ -132,27 +132,26 @@
if (Zypper::instance()->globalOpts().non_interactive)
{
MIL << "Non-interactive mode: aborting" << std::endl;
- cout_vv << description << std::endl;
- cout_vv << "Non-interactive mode: aborting" << std::endl;
return false;
}
- cout << description << std::endl;
-
// curl authentication
zypp::media::CurlAuthData * auth_data_ptr =
dynamic_castzypp::media::CurlAuthData* (&auth_data);
if (auth_data_ptr)
{
- cout_vv << "available auth types: "
- << auth_data_ptr->authTypeAsString() << std::endl;
+//! \todo move this to prompt help once it's done
+// cout_vv << "available auth types: "
+// << auth_data_ptr->authTypeAsString() << std::endl;
- cout << "User Name: ";
+ Zypper::instance()->out().prompt(
+ PROMPT_AUTH_USERNAME, description, _("User Name"));
string username;
std::cin >> username;
auth_data_ptr->setUserName(username);
- cout << "Password: ";
+ Zypper::instance()->out().prompt(
+ PROMPT_AUTH_PASSWORD, description, _("Password"));
string password;
std::cin >> password;
if (password.empty()) return false;
Modified: trunk/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/zypper-misc.cc (original)
+++ trunk/zypper/src/zypper-misc.cc Thu Feb 21 14:00:15 2008
@@ -29,6 +29,7 @@
#include "zypper-getopt.h"
#include "zypper-misc.h"
#include "zypper-callbacks.h"
+#include "output/prompt.h"
//using namespace zypp::detail;
@@ -468,11 +469,13 @@
if (solutions.empty())
return false;
// TranslatorExplanation: dependency problem solution input prompt
- cerr << _("Choose the number, (s)kip, (r)etry or (c)ancel> ") << flush;
+ zypper.out().prompt(PROMPT_DEP_RESOLVE,
+ _("Choose the number, (s)kip, (r)etry or (c)ancel"),
+ _("[#/s/r/c]"));
string reply_s = str::getline (cin, zypp::str::TRIM);
if (! cin.good()) {
- cerr_v << "cin: " << cin.rdstate() << endl;
+ zypper.out().error("cin: " + cin.rdstate());
return false;
}
if (isupper( reply_s[0] ))
@@ -491,7 +494,7 @@
str::strtonum (reply_s, reply);
} while (reply <= 0 || reply >= n);
- cout_n << format (_("Applying solution %s")) % reply << endl;
+ zypper.out().info(boost::str(format (_("Applying solution %s")) % reply), Out::HIGH);
ProblemSolutionList::iterator reply_i = solutions.begin ();
advance (reply_i, reply - 1);
todo.push_back (*reply_i);
@@ -1472,7 +1475,7 @@
int retv = show_summary(zypper);
bool was_installed = false;
if (retv >= 0) { // there are resolvables to install/uninstall
- if (read_bool_answer(_("Continue?"), true)) {
+ if (read_bool_answer(PROMPT_YN_INST_REMOVE_CONTINUE, _("Continue?"), true)) {
if (!confirm_licenses(zypper)) return;
@@ -1606,7 +1609,7 @@
string question = _("In order to install this package, you must agree"
" to terms of the above license. Continue?");
- if (!read_bool_answer(question, zypper.cmdOpts().license_auto_agree))
+ if (!read_bool_answer(PROMPT_YN_LICENSE_AGREE, question, zypper.cmdOpts().license_auto_agree))
{
confirmed = false;
Modified: trunk/zypper/src/zypper-repo-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-repo-callbacks.h?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/zypper-repo-callbacks.h (original)
+++ trunk/zypper/src/zypper-repo-callbacks.h Thu Feb 21 14:00:15 2008
@@ -26,6 +26,7 @@
#include "zypper.h"
#include "zypper-callbacks.h"
#include "zypper-utils.h"
+#include "output/prompt.h"
///////////////////////////////////////////////////////////////////
namespace ZmartRecipients
@@ -204,7 +205,7 @@
virtual Action problem( zypp::Resolvable::constPtr resolvable_ptr, Error /*error*/, const std::string & description )
{
std::cerr << description << std::endl;
- return (Action) read_action_ari(ABORT);
+ return (Action) read_action_ari(PROMPT_ARI_RPM_DOWNLOAD_PROBLEM, ABORT);
}
virtual void finish( zypp::Resolvable::constPtr /*resolvable_ptr*/, Error error, const std::string & reason )
@@ -282,7 +283,7 @@
.progressEnd("repo", "(" + _repo.name() + ") ");
// display_done ("repo", cout_n);
display_error (error, description);
- return (Action) read_action_ari (ABORT);
+ return (Action) read_action_ari (PROMPT_ARI_REPO_PROBLEM, ABORT);
}
virtual void finish( zypp::Repository /*repo*/, const std::string & task, Error error, const std::string & reason )
Modified: trunk/zypper/src/zypper-rpm-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-rpm-callbacks.h?rev=8846&r1=8845&r2=8846&view=diff
==============================================================================
--- trunk/zypper/src/zypper-rpm-callbacks.h (original)
+++ trunk/zypper/src/zypper-rpm-callbacks.h Thu Feb 21 14:00:15 2008
@@ -23,6 +23,7 @@
#include "zypper.h"
#include "zypper-callbacks.h"
#include "AliveCursor.h"
+#include "output/prompt.h"
using namespace std;
@@ -156,7 +157,7 @@
{
cerr << boost::format(_("Removal of %s failed:")) % resolvable << std::endl;
display_error (error, description);
- return (Action) read_action_ari (ABORT);
+ return (Action) read_action_ari (PROMPT_ARI_RPM_REMOVE_PROBLEM, ABORT);
}
virtual void finish( zypp::Resolvable::constPtr /*resolvable*/, Error error, const std::string & reason )
@@ -218,7 +219,7 @@
<< std::endl;
cerr << level << " "; display_error (error, description);
- return (Action) read_action_ari (ABORT);
+ return (Action) read_action_ari (PROMPT_ARI_RPM_INSTALL_PROBLEM, ABORT);
}
virtual void finish( zypp::Resolvable::constPtr /*resolvable*/, Error error, const std::string & reason, RpmLevel level )
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org