1 #include <zypp/media/MediaManager.h>
2 #include <zypp/base/String.h>
3 #include <zypp/base/Logger.h>
4 #include <zypp/Pathname.h>
5 #include <zypp/PathInfo.h>
6 #include <zypp/TmpPath.h>
7 #include <zypp/ExternalProgram.h>
18 using namespace zypp::media;
32 #define ONE_STEP(MSG) \
34 DBG << "======================================" << std::endl; \
35 DBG << "==>> " << MSG << std::endl; \
36 DBG << "======================================" << std::endl; \
37 if( do_step) { pause(); if( do_quit) exit(0); } \
40 int main(int argc, char *argv[])
44 sigemptyset(&sa.sa_mask);
47 sigaction(SIGINT, &sa, NULL);
49 sigaction(SIGTERM, &sa, NULL);
51 if( argc > 1 && std::string(argv[1]) == "-i")
58 Pathname dir("./suse/setup/descr");
64 ONE_STEP("open " + url.asString());
70 ONE_STEP("provideDirTree(" + dir.asString() + ")");
71 mm.provideDirTree(id, Pathname(dir));
73 ONE_STEP("Create a temporary dir");
74 zypp::filesystem::TmpDir temp;
76 ONE_STEP("Create a copy of " + dir.asString());
77 zypp::filesystem::copy_dir(mm.localPath(id, dir), temp.path());
79 std::string cmd("/bin/ls -lR ");
80 cmd += temp.path().asString();
82 ONE_STEP("Check the directory copy")
87 catch(const MediaException &e)
94 ERR << "Catched *unknown* exception" << std::endl;
100 // vim: set ts=2 sts=2 sw=2 ai et: