handle border cases
[platform/upstream/libzypp.git] / devel / devel.dmacvicar / SUSETagsDownloader_tp.cc
1 #include <sys/time.h>
2
3 #include <iostream>
4 #include <fstream>
5
6 #include <list>
7 #include <set>
8
9 #include <zypp/base/Logger.h>
10 #include <zypp/base/String.h>
11 #include <zypp/ZYpp.h>
12 #include <zypp/ZYppFactory.h>
13 #include <zypp/media/MediaAccess.h>
14 #include <zypp/media/MediaManager.h>
15 #include <zypp/MediaSetAccess.h>
16 #include <zypp/source/SUSEMediaVerifier.h>
17 #include <zypp/OnMediaLocation.h>
18 #include <zypp/repo/susetags/Downloader.h>
19 #include <zypp/Fetcher.h>
20
21 #include "zypp/Product.h"
22 #include "zypp/Package.h"
23
24
25 using namespace std;
26 using namespace zypp;
27 using namespace media;
28 using namespace repo::susetags;
29
30 int main(int argc, char **argv)
31 {
32     if (argc < 3) {
33         cerr << "Usage: " << argv[0] << " <url> <destination>" << std::endl;
34         return 1;
35     }
36     try
37     {
38       ZYpp::Ptr z = getZYpp();
39       Downloader downloader(Url(argv[1]), "/");
40       downloader.download(argv[2]);
41     }
42     catch ( const Exception &e )
43     {
44       cout << "ups! " << e.msg() << std::endl;
45     }
46     return 0;
47 }
48
49
50