Author: jkupec
Date: Thu Jun 21 17:10:10 2007
New Revision: 5822
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5822&view=rev
Log:
adapted to libzypp after removing the old API (libzypp r5820, branch
REFACTORING-10_3)
Modified:
trunk/zypper/src/zypp-checkpatches.cc
trunk/zypper/src/zypper-info.cc
trunk/zypper/src/zypper-media-callbacks.h
trunk/zypper/src/zypper-misc.cc
trunk/zypper/src/zypper-search.h
trunk/zypper/src/zypper-source-callbacks.h
trunk/zypper/src/zypper-tabulator.cc
trunk/zypper/src/zypper-updates.cc
trunk/zypper/src/zypper.cc
Modified: trunk/zypper/src/zypp-checkpatches.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypp-checkpatches.cc?rev=5822&r1=5821&r2=5822&view=diff
==============================================================================
--- trunk/zypper/src/zypp-checkpatches.cc (original)
+++ trunk/zypper/src/zypp-checkpatches.cc Thu Jun 21 17:10:10 2007
@@ -9,6 +9,7 @@
/* (c) Novell Inc. */
+#include
#include <iostream>
#include <fstream>
@@ -17,6 +18,7 @@
#include
#include
#include
+#include
#include "checkpatches-keyring-callbacks.h"
#include "zypper.h"
Modified: trunk/zypper/src/zypper-info.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-info.cc?rev=5822&r1=5821&r2=5822&view=diff
==============================================================================
--- trunk/zypper/src/zypper-info.cc (original)
+++ trunk/zypper/src/zypper-info.cc Thu Jun 21 17:10:10 2007
@@ -81,7 +81,7 @@
*/
void printPkgInfo(const PoolItem & pool_item, const PoolItem & ins_pool_item) {
- cout << _("Catalog: ") << pool_item.resolvable()->source().alias() << endl;
+ cout << _("Catalog: ") << pool_item.resolvable()->repository().info().alias() << endl;
cout << _("Name: ") << pool_item.resolvable()->name() << endl;
cout << _("Version: ") << pool_item.resolvable()->edition().asString() << endl;
cout << _("Arch: ") << pool_item.resolvable()->arch().asString() << endl;
Modified: trunk/zypper/src/zypper-media-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-media-callbacks.h?rev=5822&r1=5821&r2=5822&view=diff
==============================================================================
--- trunk/zypper/src/zypper-media-callbacks.h (original)
+++ trunk/zypper/src/zypper-media-callbacks.h Thu Jun 21 17:10:10 2007
@@ -21,7 +21,6 @@
#include
#include
#include
-#include
#include "AliveCursor.h"
@@ -33,7 +32,7 @@
{
struct MediaChangeReportReceiver : public zypp::callback::ReceiveReport<MediaChangeReport>
- {
+ {/*
virtual MediaChangeReport::Action requestMedia( zypp::Source_Ref source, unsigned mediumNr, MediaChangeReport::Error error, const std::string & description )
{
cout << "Please insert media [" << description << "] # " << mediumNr << ". Retry [y/n]: " << endl;
@@ -43,6 +42,7 @@
return MediaChangeReport::ABORT;
}
+ */
};
// progress for downloading a file
Modified: trunk/zypper/src/zypper-misc.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-misc.cc?rev=5822&r1=5821&r2=5822&view=diff
==============================================================================
--- trunk/zypper/src/zypper-misc.cc (original)
+++ trunk/zypper/src/zypper-misc.cc Thu Jun 21 17:10:10 2007
@@ -435,7 +435,7 @@
cout_vv << format(_("(%d resolvables found)")) % store.size() << endl;
}
- catch ( const repo::RepoNotCachedException &e )
+ catch (const Exception & e)
{
ZYPP_CAUGHT(e);
cerr << format(_("Problem loading data from '%s'")) % repo.alias();
@@ -553,7 +553,7 @@
Patch::constPtr patch = asKind<Patch>(res);
TableRow tr;
- tr << patch->source ().alias ();
+ tr << patch->repository().info().alias ();
tr << res->name () << res->edition ().asString();
tr << patch->category();
tr << string_status (it->status ());
@@ -589,7 +589,7 @@
if (true) {
TableRow tr (cols);
- tr << patch->source ().alias ();
+ tr << patch->repository().info().alias ();
tr << res->name () << res->edition ().asString();
tr << patch->category();
tr << string_status (it->status ());
@@ -726,7 +726,7 @@
// candstat.setToBeInstalled (ResStatus::USER);
ResObject::constPtr res = ci->resolvable();
TableRow tr (cols);
- tr << "v" << res->source ().alias ();
+ tr << "v" << res->repository().info().alias();
if (gSettings.is_rug_compatible)
tr << ""; // Bundle
tr << res->name ()
Modified: trunk/zypper/src/zypper-search.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-search.h?rev=5822&r1=5821&r2=5822&view=diff
==============================================================================
--- trunk/zypper/src/zypper-search.h (original)
+++ trunk/zypper/src/zypper-search.h Thu Jun 21 17:10:10 2007
@@ -262,7 +262,7 @@
}
// add other fields to the result table
- row << pool_item.resolvable()->source().alias()
+ row << pool_item.resolvable()->repository().info().alias()
// TODO what about rug's Bundle?
<< (gSettings.is_rug_compatible ? "" : pool_item.resolvable()->kind().asString())
<< pool_item.resolvable()->name()
Modified: trunk/zypper/src/zypper-source-callbacks.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-source-callbacks.h?rev=5822&r1=5821&r2=5822&view=diff
==============================================================================
--- trunk/zypper/src/zypper-source-callbacks.h (original)
+++ trunk/zypper/src/zypper-source-callbacks.h Thu Jun 21 17:10:10 2007
@@ -20,7 +20,6 @@
#include
#include
#include
-#include
#include "zypper-callbacks.h"
@@ -28,8 +27,7 @@
namespace ZmartRecipients
{
///////////////////////////////////////////////////////////////////
-#ifndef LIBZYPP_1xx
- // progress for probing a source
+/* // progress for probing a source
struct ProbeSourceReceive : public zypp::callback::ReceiveReportzypp::source::ProbeSourceReport
{
virtual void start(const zypp::Url &url)
@@ -37,7 +35,7 @@
cout << "Determining " << url << " source type..." << endl;
}
- virtual void failedProbe( const zypp::Url &/*url*/, const std::string & type )
+ virtual void failedProbe( const zypp::Url &/*url*//*, const std::string & type )
{
cout << ".. not " << type << endl;
}
@@ -47,7 +45,7 @@
cout << url << " is type " << type << endl;
}
- virtual void finish(const zypp::Url &/*url*/, Error error, const std::string & reason )
+ virtual void finish(const zypp::Url &/*url*//*, Error error, const std::string & reason )
{
if ( error == INVALID )
{
@@ -56,10 +54,10 @@
}
}
- virtual bool progress(const zypp::Url &/*url*/, int /*value*/)
+ virtual bool progress(const zypp::Url &/*url*//*, int /*value*//*)
{ return true; }
- virtual Action problem( const zypp::Url &/*url*/, Error error, const std::string & description )
+ virtual Action problem( const zypp::Url &/*url*//*, Error error, const std::string & description )
{
display_done ();
display_error (error, description);
@@ -67,8 +65,7 @@
return ABORT;
}
};
-#endif
-
+ */
// progress for downloading a resolvable
struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReportzypp::source::DownloadResolvableReport
{
@@ -203,7 +200,7 @@
}
};
-#ifndef LIBZYPP_1xx
+/*
struct SourceReportReceiver : public zypp::callback::ReceiveReportzypp::source::SourceReport
{
virtual void start( zypp::Source_Ref source, const std::string & task )
@@ -225,14 +222,14 @@
return true;
}
- virtual Action problem( zypp::Source_Ref /*source*/, Error error, const std::string & description )
+ virtual Action problem( zypp::Source_Ref /*source*//*, Error error, const std::string & description )
{
display_done ();
display_error (error, description);
return (Action) read_action_ari ();
}
- virtual void finish( zypp::Source_Ref /*source*/, const std::string & task, Error error, const std::string & reason )
+ virtual void finish( zypp::Source_Ref /*source*//*, const std::string & task, Error error, const std::string & reason )
{
display_step(100);
// many of these, avoid newline
@@ -246,8 +243,7 @@
std::string _task;
zypp::Source_Ref _source;
};
-#endif
-
+*/
///////////////////////////////////////////////////////////////////
}; // namespace ZmartRecipients
///////////////////////////////////////////////////////////////////
@@ -255,27 +251,21 @@
class SourceCallbacks {
private:
-#ifndef LIBZYPP_1xx
- ZmartRecipients::ProbeSourceReceive _sourceProbeReport;
- ZmartRecipients::SourceReportReceiver _SourceReport;
-#endif
+// ZmartRecipients::ProbeSourceReceive _sourceProbeReport;
+// ZmartRecipients::SourceReportReceiver _SourceReport;
ZmartRecipients::DownloadResolvableReportReceiver _downloadReport;
public:
SourceCallbacks()
{
-#ifndef LIBZYPP_1xx
- _sourceProbeReport.connect();
- _SourceReport.connect();
-#endif
+// _sourceProbeReport.connect();
+// _SourceReport.connect();
_downloadReport.connect();
}
~SourceCallbacks()
{
-#ifndef LIBZYPP_1xx
- _sourceProbeReport.disconnect();
- _SourceReport.disconnect();
-#endif
+// _sourceProbeReport.disconnect();
+// _SourceReport.disconnect();
_downloadReport.disconnect();
}
Modified: trunk/zypper/src/zypper-tabulator.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-tabulator.cc?rev=5822&r1=5821&r2=5822&view=diff
==============================================================================
--- trunk/zypper/src/zypper-tabulator.cc (original)
+++ trunk/zypper/src/zypper-tabulator.cc Thu Jun 21 17:10:10 2007
@@ -5,7 +5,7 @@
TableStyle Table::defaultStyle = Ascii;
static
-char * lines[][3] = {
+const char * lines[][3] = {
{ "|", "-", "+"}, ///< Ascii
// utf 8. TODO wchars?
{ "\xE2\x94\x82", "\xE2\x94\x80", "\xE2\x94\xBC"}, ///< light
@@ -38,7 +38,7 @@
void TableRow::dumpTo (ostream &stream, const vector<unsigned>& widths,
TableStyle st) const {
- char * vline = lines[st][0];
+ const char * vline = lines[st][0];
bool seen_first = false;
container::const_iterator
@@ -90,8 +90,8 @@
}
void Table::dumpRule (ostream &stream) const {
- char * hline = lines[_style][1];
- char * cross = lines[_style][2];
+ const char * hline = lines[_style][1];
+ const char * cross = lines[_style][2];
bool seen_first = false;
Modified: trunk/zypper/src/zypper-updates.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypper-updates.cc?rev=5822&r1=5821&r2=5822&view=diff
==============================================================================
--- trunk/zypper/src/zypper-updates.cc (original)
+++ trunk/zypper/src/zypper-updates.cc Thu Jun 21 17:10:10 2007
@@ -102,8 +102,8 @@
out << " category() << "\" name=\"" << patch->name() << "\" edition=\"" << patch->edition() << "\"" << ">" << std::endl;
out << " <summary>" << xml_escape(patch->summary()) << "</summary>" << endl;
out << " <description>" << xml_escape(patch->description()) << "</description>" << endl;
- if ( patch->source() != Source_Ref::noSource )
- out << "