/* (c) Novell Inc. */
+#include <fcntl.h>
#include <iostream>
#include <fstream>
#include <zypp/base/Gettext.h>
#include <zypp/target/store/PersistentStorage.h>
#include <zypp/RepoManager.h>
+#include <zypp/PathInfo.h>
#include "checkpatches-keyring-callbacks.h"
#include "zypper.h"
*/
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;
#include <zypp/KeyRing.h>
#include <zypp/Digest.h>
#include <zypp/Url.h>
-#include <zypp/Source.h>
#include "AliveCursor.h"
{
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;
return MediaChangeReport::ABORT;
}
+ */
};
// progress for downloading a file
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();
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 ());
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 ());
// 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 ()
}
// 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()
#include <zypp/KeyRing.h>
#include <zypp/Digest.h>
#include <zypp/Url.h>
-#include <zypp/Source.h>
#include "zypper-callbacks.h"
namespace ZmartRecipients
{
///////////////////////////////////////////////////////////////////
-#ifndef LIBZYPP_1xx
- // progress for probing a source
+/* // progress for probing a source
struct ProbeSourceReceive : public zypp::callback::ReceiveReport<zypp::source::ProbeSourceReport>
{
virtual void start(const zypp::Url &url)
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;
}
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 )
{
}
}
- 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);
return ABORT;
}
};
-#endif
-
+ */
// progress for downloading a resolvable
struct DownloadResolvableReportReceiver : public zypp::callback::ReceiveReport<zypp::source::DownloadResolvableReport>
{
}
};
-#ifndef LIBZYPP_1xx
+/*
struct SourceReportReceiver : public zypp::callback::ReceiveReport<zypp::source::SourceReport>
{
virtual void start( zypp::Source_Ref source, const std::string & task )
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
std::string _task;
zypp::Source_Ref _source;
};
-#endif
-
+*/
///////////////////////////////////////////////////////////////////
}; // namespace ZmartRecipients
///////////////////////////////////////////////////////////////////
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();
}
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
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
}
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;
out << " <update category=\"" << patch ->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 << "<source url=\"" << patch->source().url() << "\" alias=\"" << patch->source().alias() << "\"/>" << std::endl;
+ if ( patch->repository() != Repository::noRepository )
+ out << "<source url=\"" << *(patch->repository().info().baseUrlsBegin()) << "\" alias=\"" << patch->repository().info().alias() << "\"/>" << std::endl;
out << "</update>" << endl;
count++;
"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}
// --------------------------( 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;