* updated ksystemlog (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / source / Download.cc
blob84d1c0838fb5129bd1363a9349b41783c59e2368
2 #include <ostream>
4 #include "desc-parser.hh"
6 int main (int argc, char* argv[])
8 Package package;
10 for (int i = 1; i < argc; ++i)
12 package.Clear();
13 package.ParsePackage (argv[i]);
15 unsigned int no_downloads = package.download.download_infos.size();
17 for (unsigned int dl=0; dl < no_downloads; dl++) {
18 DownloadInfo& info=package.download.download_infos[dl];
20 // TODO: Choose type out of mirror and nodist. Not yet
21 // used in tree - and imperfectly implemented in rock ...
22 std::string store_url = "download/";
23 store_url += "mirror/";
24 store_url += info.file[0];
25 store_url += + "/";
26 store_url += info.file;
28 if (info.protocol == "http" || info.protocol == "ftp") {
29 std::cerr << "Would download: " << info.down_url
30 << " -> " << store_url << std::endl;
32 else
33 std::cerr << "Error: protocol '" << info.protocol
34 << "' not yet implemented" << std::endl;