Mailinglist Archive: zypp-commit (348 mails)
| < Previous | Next > |
[zypp-commit] r9148 - in /trunk/zypper/src: output/OutNormal.cc output/OutXML.cc zypper-prompt.cc zypper-utils.cc
- From: jkupec@xxxxxxxxxxxxxxxx
- Date: Fri, 14 Mar 2008 09:47:45 -0000
- Message-id: <20080314094745.7DB993116C@xxxxxxxxxxxxxxxx>
Author: jkupec
Date: Fri Mar 14 10:47:45 2008
New Revision: 9148
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9148&view=rev
Log:
- compile
Modified:
trunk/zypper/src/output/OutNormal.cc
trunk/zypper/src/output/OutXML.cc
trunk/zypper/src/zypper-prompt.cc
trunk/zypper/src/zypper-utils.cc
Modified: trunk/zypper/src/output/OutNormal.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutNormal.cc?rev=9148&r1=9147&r2=9148&view=diff
==============================================================================
--- trunk/zypper/src/output/OutNormal.cc (original)
+++ trunk/zypper/src/output/OutNormal.cc Fri Mar 14 10:47:45 2008
@@ -200,10 +200,11 @@
{
string option_str;
PromptOptions::OptionList::const_iterator it;
- if (poptions.options().begin() != poptions.end())
+ if ((it = poptions.options().begin()) != poptions.options().end())
{
//if (is_default) // TODO
option_str += *it;
+ ++it;
}
for (;
it != poptions.options().end(); ++it)
Modified: trunk/zypper/src/output/OutXML.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutXML.cc?rev=9148&r1=9147&r2=9148&view=diff
==============================================================================
--- trunk/zypper/src/output/OutXML.cc (original)
+++ trunk/zypper/src/output/OutXML.cc Fri Mar 14 10:47:45 2008
@@ -199,7 +199,7 @@
{
string option = *it;
cout << "<option";
- if (options.defaultOpt() == i)
+ if (poptions.defaultOpt() == i)
cout << " default=\"1\"";
cout << " value=\"" << xml_encode(option) << "\"";
cout << "/>" << endl;
Modified: trunk/zypper/src/zypper-prompt.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-prompt.cc?rev=9148&r1=9147&r2=9148&view=diff
==============================================================================
--- trunk/zypper/src/zypper-prompt.cc (original)
+++ trunk/zypper/src/zypper-prompt.cc Fri Mar 14 10:47:45 2008
@@ -16,7 +16,7 @@
PromptOptions::PromptOptions(const std::string option_str, unsigned int
default_opt)
{
- zypp::str::split(answer_hint, back_inserter(_options), "/");
+ zypp::str::split(option_str, back_inserter(_options), "/");
if (_options.size() <= default_opt)
INT << "Invalid default option index " << default_opt << endl;
@@ -41,7 +41,8 @@
// the anserws must be separated by slash characters '/' and must
// correspond to abort/retry/ignore in that order.
// The answers should be lower case letters.
- out.prompt(pid, _("Abort, retry, ignore?"), _("a/r/i"));
+ PromptOptions popts(_("a/r/i"), 0);
+ out.prompt(pid, _("Abort, retry, ignore?"), popts);
// choose abort if no default has been specified
if (default_action == -1) {
@@ -79,7 +80,7 @@
ostringstream s;
s << format(_("Invalid answer '%s'.")) % c << " "
<< _("Choose letter 'a', 'r', or 'i'");
- out.prompt(pid, s.str(), _("a/r/i")); //! \todo remove this, handle
invalid answers within the first prompt()
+ out.prompt(pid, s.str(), popts); //! \todo remove this, handle invalid
answers within the first prompt()
DBG << "invalid answer" << endl;
}
@@ -95,7 +96,8 @@
string yn = string(_("yes")) + "/" + _("no");
- out.prompt(pid, question, yn);
+ PromptOptions popts(yn, default_answer ? 0 : 1);
+ out.prompt(pid, question, popts);
// non-interactive mode: print the answer for convenience (only for normal
// output) and return default
@@ -121,7 +123,7 @@
// The second and the third %s is the translated 'yes' and 'no' string
(lowercase).
_("Enter 'y' for '%s' or 'n' for '%s' if nothing else works for you"))
% _("yes") % _("no");
- out.prompt(pid, s.str(), yn); //! \todo remove this, handle invalid
answers within the first prompt()
+ out.prompt(pid, s.str(), popts); //! \todo remove this, handle invalid
answers within the first prompt()
}
c = zypp::str::getline (stm, zypp::str::TRIM);
been_here_before = true;
Modified: trunk/zypper/src/zypper-utils.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-utils.cc?rev=9148&r1=9147&r2=9148&view=diff
==============================================================================
--- trunk/zypper/src/zypper-utils.cc (original)
+++ trunk/zypper/src/zypper-utils.cc Fri Mar 14 10:47:45 2008
@@ -9,9 +9,10 @@
#include "zypp/media/MediaManager.h"
#include "zypp/parser/xml_escape_parser.hpp"
+#include "zypper.h"
#include "zypper-main.h"
#include "zypper-utils.h"
-//#include "zypper-callbacks.h"
+
using namespace std;
using namespace zypp;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
Date: Fri Mar 14 10:47:45 2008
New Revision: 9148
URL: http://svn.opensuse.org/viewcvs/zypp?rev=9148&view=rev
Log:
- compile
Modified:
trunk/zypper/src/output/OutNormal.cc
trunk/zypper/src/output/OutXML.cc
trunk/zypper/src/zypper-prompt.cc
trunk/zypper/src/zypper-utils.cc
Modified: trunk/zypper/src/output/OutNormal.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutNormal.cc?rev=9148&r1=9147&r2=9148&view=diff
==============================================================================
--- trunk/zypper/src/output/OutNormal.cc (original)
+++ trunk/zypper/src/output/OutNormal.cc Fri Mar 14 10:47:45 2008
@@ -200,10 +200,11 @@
{
string option_str;
PromptOptions::OptionList::const_iterator it;
- if (poptions.options().begin() != poptions.end())
+ if ((it = poptions.options().begin()) != poptions.options().end())
{
//if (is_default) // TODO
option_str += *it;
+ ++it;
}
for (;
it != poptions.options().end(); ++it)
Modified: trunk/zypper/src/output/OutXML.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/output/OutXML.cc?rev=9148&r1=9147&r2=9148&view=diff
==============================================================================
--- trunk/zypper/src/output/OutXML.cc (original)
+++ trunk/zypper/src/output/OutXML.cc Fri Mar 14 10:47:45 2008
@@ -199,7 +199,7 @@
{
string option = *it;
cout << "<option";
- if (options.defaultOpt() == i)
+ if (poptions.defaultOpt() == i)
cout << " default=\"1\"";
cout << " value=\"" << xml_encode(option) << "\"";
cout << "/>" << endl;
Modified: trunk/zypper/src/zypper-prompt.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-prompt.cc?rev=9148&r1=9147&r2=9148&view=diff
==============================================================================
--- trunk/zypper/src/zypper-prompt.cc (original)
+++ trunk/zypper/src/zypper-prompt.cc Fri Mar 14 10:47:45 2008
@@ -16,7 +16,7 @@
PromptOptions::PromptOptions(const std::string option_str, unsigned int
default_opt)
{
- zypp::str::split(answer_hint, back_inserter(_options), "/");
+ zypp::str::split(option_str, back_inserter(_options), "/");
if (_options.size() <= default_opt)
INT << "Invalid default option index " << default_opt << endl;
@@ -41,7 +41,8 @@
// the anserws must be separated by slash characters '/' and must
// correspond to abort/retry/ignore in that order.
// The answers should be lower case letters.
- out.prompt(pid, _("Abort, retry, ignore?"), _("a/r/i"));
+ PromptOptions popts(_("a/r/i"), 0);
+ out.prompt(pid, _("Abort, retry, ignore?"), popts);
// choose abort if no default has been specified
if (default_action == -1) {
@@ -79,7 +80,7 @@
ostringstream s;
s << format(_("Invalid answer '%s'.")) % c << " "
<< _("Choose letter 'a', 'r', or 'i'");
- out.prompt(pid, s.str(), _("a/r/i")); //! \todo remove this, handle
invalid answers within the first prompt()
+ out.prompt(pid, s.str(), popts); //! \todo remove this, handle invalid
answers within the first prompt()
DBG << "invalid answer" << endl;
}
@@ -95,7 +96,8 @@
string yn = string(_("yes")) + "/" + _("no");
- out.prompt(pid, question, yn);
+ PromptOptions popts(yn, default_answer ? 0 : 1);
+ out.prompt(pid, question, popts);
// non-interactive mode: print the answer for convenience (only for normal
// output) and return default
@@ -121,7 +123,7 @@
// The second and the third %s is the translated 'yes' and 'no' string
(lowercase).
_("Enter 'y' for '%s' or 'n' for '%s' if nothing else works for you"))
% _("yes") % _("no");
- out.prompt(pid, s.str(), yn); //! \todo remove this, handle invalid
answers within the first prompt()
+ out.prompt(pid, s.str(), popts); //! \todo remove this, handle invalid
answers within the first prompt()
}
c = zypp::str::getline (stm, zypp::str::TRIM);
been_here_before = true;
Modified: trunk/zypper/src/zypper-utils.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-utils.cc?rev=9148&r1=9147&r2=9148&view=diff
==============================================================================
--- trunk/zypper/src/zypper-utils.cc (original)
+++ trunk/zypper/src/zypper-utils.cc Fri Mar 14 10:47:45 2008
@@ -9,9 +9,10 @@
#include "zypp/media/MediaManager.h"
#include "zypp/parser/xml_escape_parser.hpp"
+#include "zypper.h"
#include "zypper-main.h"
#include "zypper-utils.h"
-//#include "zypper-callbacks.h"
+
using namespace std;
using namespace zypp;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx
| < Previous | Next > |