- finally the cacher and parser connect together
[platform/upstream/libzypp.git] / devel / devel.dmacvicar / testbed.cc
1 #include <iostream>
2 #include <fstream>
3 #include <sstream>
4 #include <streambuf>
5
6 #include "boost/filesystem/operations.hpp" // includes boost/filesystem/path.hpp
7 #include "boost/filesystem/fstream.hpp"    // ditto
8
9 #include <boost/iostreams/device/file_descriptor.hpp>
10
11 #include <zypp/base/Logger.h>
12 #include <zypp/Locale.h>
13 #include <zypp/ZYpp.h>
14 #include <zypp/ZYppFactory.h>
15 #include <zypp/TranslatedText.h>
16 ///////////////////////////////////////////////////////////////////
17
18 #include <zypp/base/Logger.h>
19
20
21 #include <map>
22 #include <set>
23
24 #include "zypp/CapFactory.h"
25 #include "zypp/KeyRing.h"
26 #include "zypp/PublicKey.h"
27
28 #include "zypp/MediaSetAccess.h"
29 #include "zypp/source/yum/YUMSourceCacher.h"
30
31 using namespace zypp::detail;
32
33 using namespace std;
34 using namespace zypp;
35 using namespace zypp::source;
36 //using namespace DbXml;
37
38 int main()
39 {
40   //MediaSetAccess ma( Url("cd:///"), Pathname("/"));
41   //MIL << "done 1" << std::endl;
42   //ChecksumFileChecker checker(CheckSum("sha1", "fa0abb22f703a3a41f7a39f0844b24daf572fd4c"));
43   //Pathname local = ma.provideFile("content", 1, checker);
44   //MIL << local << std::endl;
45   try
46   {
47     zypp::source::yum::YUMSourceCacher cacher(Pathname("/"));
48     cacher.cache( Url("http://ftp-1.gwdg.de/pub/opensuse/distribution/SL-OSS-factory/inst-source/suse"), Pathname("/"));
49   }
50   catch ( const Exception &e )
51   {
52     MIL << "Sorry, bye" << endl;
53   }
54 }
55
56