6 #include <zypp/base/Logger.h>
8 #include <zypp/ZYppFactory.h>
10 #include "zypp/Product.h"
11 #include "zypp/Package.h"
12 #include "zypp/Fetcher.h"
13 #include "zypp/TmpPath.h"
14 #include "zypp/ProgressData.h"
16 #include "zypp/sat/Pool.h"
18 #include "zypp/ZYppCallbacks.h"
22 using namespace zypp::repo;
23 using zypp::media::MediaChangeReport;
26 bool result_cb( const ResObject::Ptr &r )
31 struct MediaChangeReportReceiver : public zypp::callback::ReceiveReport<MediaChangeReport>
33 virtual MediaChangeReport::Action
34 requestMedia(zypp::Url & url,
36 const std::string & label,
37 MediaChangeReport::Error error,
38 const std::string & description,
39 const std::vector<std::string> & devices,
43 MIL << "media problem, url: " << url.asString() << std::endl;
44 return MediaChangeReport::IGNORE;
49 int main(int argc, char **argv)
53 ZYpp::Ptr z = getZYpp();
55 MediaChangeReportReceiver report;
60 MediaSetAccess access(Url("http://ftp.kernel.org/pub"));
61 filesystem::TmpDir tmp;
64 loc.setLocation("/README2");
65 loc.setOptional(true);
68 fetcher.start(tmp.path(), access);
71 catch ( const Exception &e )
74 cout << e.msg() << endl;