From ab59c389c1c3796cf3398279fb7f68acc84adf22 Mon Sep 17 00:00:00 2001 From: Jan Kupec Date: Thu, 21 Jun 2007 15:10:10 +0000 Subject: [PATCH] adapted to libzypp after removing the old API (libzypp r5820, branch REFACTORING-10_3) --- src/zypp-checkpatches.cc | 2 ++ src/zypper-info.cc | 2 +- src/zypper-media-callbacks.h | 4 ++-- src/zypper-misc.cc | 8 ++++---- src/zypper-search.h | 2 +- src/zypper-source-callbacks.h | 42 ++++++++++++++++-------------------------- src/zypper-tabulator.cc | 8 ++++---- src/zypper-updates.cc | 4 ++-- src/zypper.cc | 4 ++-- 9 files changed, 34 insertions(+), 42 deletions(-) diff --git a/src/zypp-checkpatches.cc b/src/zypp-checkpatches.cc index b9778b0..5009781 100644 --- a/src/zypp-checkpatches.cc +++ b/src/zypp-checkpatches.cc @@ -9,6 +9,7 @@ /* (c) Novell Inc. */ +#include #include #include @@ -17,6 +18,7 @@ #include #include #include +#include #include "checkpatches-keyring-callbacks.h" #include "zypper.h" diff --git a/src/zypper-info.cc b/src/zypper-info.cc index c346b3e..43a9184 100644 --- a/src/zypper-info.cc +++ b/src/zypper-info.cc @@ -81,7 +81,7 @@ Copy and modify /usr/share/vim/current/gvimrc to ~/.gvimrc if needed. */ 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; diff --git a/src/zypper-media-callbacks.h b/src/zypper-media-callbacks.h index e108aaa..686bdf6 100644 --- a/src/zypper-media-callbacks.h +++ b/src/zypper-media-callbacks.h @@ -21,7 +21,6 @@ #include #include #include -#include #include "AliveCursor.h" @@ -33,7 +32,7 @@ namespace ZmartRecipients { struct MediaChangeReportReceiver : public zypp::callback::ReceiveReport - { + {/* 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 @@ namespace ZmartRecipients return MediaChangeReport::ABORT; } + */ }; // progress for downloading a file diff --git a/src/zypper-misc.cc b/src/zypper-misc.cc index f75cdf7..53b0fb6 100644 --- a/src/zypper-misc.cc +++ b/src/zypper-misc.cc @@ -435,7 +435,7 @@ void load_repo_resolvables() 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 @@ void show_patches() Patch::constPtr patch = asKind(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 @@ void list_patch_updates () 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 @@ void list_updates( const ResObject::Kind &kind ) // 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 () diff --git a/src/zypper-search.h b/src/zypper-search.h index 2eccf5c..f26a5a0 100644 --- a/src/zypper-search.h +++ b/src/zypper-search.h @@ -262,7 +262,7 @@ struct FillTable } // 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() diff --git a/src/zypper-source-callbacks.h b/src/zypper-source-callbacks.h index 2578a01..1a5d58a 100644 --- a/src/zypper-source-callbacks.h +++ b/src/zypper-source-callbacks.h @@ -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::ReceiveReport { virtual void start(const zypp::Url &url) @@ -37,7 +35,7 @@ namespace ZmartRecipients 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 @@ namespace ZmartRecipients 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 @@ namespace ZmartRecipients } } - 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 @@ namespace ZmartRecipients return ABORT; } }; -#endif - + */ // progress for downloading a resolvable struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReport { @@ -203,7 +200,7 @@ struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReport { virtual void start( zypp::Source_Ref source, const std::string & task ) @@ -225,14 +222,14 @@ struct SourceReportReceiver : public zypp::callback::ReceiveReport& 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::updateColWidths (const TableRow& tr) { } 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; diff --git a/src/zypper-updates.cc b/src/zypper-updates.cc index f7c521d..2764a7f 100644 --- a/src/zypper-updates.cc +++ b/src/zypper-updates.cc @@ -102,8 +102,8 @@ void render_result( const Edition &version, std::ostream &out, const zypp::ResPo out << " category() << "\" name=\"" << patch->name() << "\" edition=\"" << patch->edition() << "\"" << ">" << std::endl; out << " " << xml_escape(patch->summary()) << "" << endl; out << " " << xml_escape(patch->description()) << "" << endl; - if ( patch->source() != Source_Ref::noSource ) - out << "source().url() << "\" alias=\"" << patch->source().alias() << "\"/>" << std::endl; + if ( patch->repository() != Repository::noRepository ) + out << "repository().info().baseUrlsBegin()) << "\" alias=\"" << patch->repository().info().alias() << "\"/>" << std::endl; out << "" << endl; count++; diff --git a/src/zypper.cc b/src/zypper.cc index b093f82..72a36b4 100644 --- a/src/zypper.cc +++ b/src/zypper.cc @@ -435,7 +435,7 @@ int one_command(const ZypperCommand & command, int argc, char **argv) "This command has no options.\n" ); } - else if (command == ZypperCommand::NONE) {//command_str == "patches" || command_str == "pch") { + else if (command == ZypperCommand::SHOW_PATCHES) { static struct option patches_options[] = { {"help", no_argument, 0, 'h'}, {0, 0, 0, 0} @@ -844,7 +844,7 @@ int one_command(const ZypperCommand & command, int argc, char **argv) // --------------------------( patches )------------------------------------ - else if (command == ZypperCommand::NONE) {//command_str == "patches" || command_str == "pch") { + else if (command == ZypperCommand::SHOW_PATCHES) { if (ghelp) { cerr << specific_help; return !ghelp; -- 2.7.4