From: Jan Kupec Date: Mon, 28 Jul 2008 15:19:55 +0000 (+0000) Subject: - backup X-Git-Tag: BASE-SuSE-Code-11-Branch~564 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d9e6c1dce1bc0ab4d6659b1daaaa5c6db0f41064;p=platform%2Fupstream%2Flibzypp.git - backup --- diff --git a/devel/devel.jkupec/CMakeLists.txt b/devel/devel.jkupec/CMakeLists.txt index 56d1cc8..252665d 100644 --- a/devel/devel.jkupec/CMakeLists.txt +++ b/devel/devel.jkupec/CMakeLists.txt @@ -1,6 +1,6 @@ ADD_DEFINITIONS( - -DSRC_DIR=\\\"${CMAKE_CURRENT_SOURCE_DIR}\\\" - -DTESTS_SRC_DIR=\\\"${CMAKE_SOURCE_DIR}/tests\\\" + -DSRC_DIR="${CMAKE_CURRENT_SOURCE_DIR}" + -DTESTS_SRC_DIR="${CMAKE_SOURCE_DIR}/tests" ) SET( bridge_SRCS @@ -32,3 +32,6 @@ TARGET_LINK_LIBRARIES( repos zypp ) #ADD_EXECUTABLE( yumparsertest YUMParser_test.cc ) #TARGET_LINK_LIBRARIES( yumparsertest zypp ) + +ADD_EXECUTABLE( play play.cc ) +TARGET_LINK_LIBRARIES( play zypp boost_signals ) diff --git a/devel/devel.jkupec/play.cc b/devel/devel.jkupec/play.cc new file mode 100644 index 0000000..fb5ea6d --- /dev/null +++ b/devel/devel.jkupec/play.cc @@ -0,0 +1,18 @@ +#include + +#include "zypp/base/LogTools.h" + +using std::endl; +using std::cout; + + +// --------------------------------------------------------------------------- + +int main( int argc, const char * argv[] ) +{ + --argc; ++argv; // skip arg 0 + + cout << "done" << endl; + return 0; +} + diff --git a/devel/devel.jkupec/poolquery.cc b/devel/devel.jkupec/poolquery.cc index d1f485f..e471807 100644 --- a/devel/devel.jkupec/poolquery.cc +++ b/devel/devel.jkupec/poolquery.cc @@ -40,6 +40,8 @@ static void init_pool() sat::Pool::instance().addRepoSolv(dir / "factory-nonoss.solv", i2); RepoInfo i3; i3.setAlias("zypp_svn"); sat::Pool::instance().addRepoSolv(dir / "zypp_svn.solv", i3); + RepoInfo i5; i5.setAlias("pyton"); + sat::Pool::instance().addRepoSolv(dir / "python.solv", i5); RepoInfo i4; i4.setAlias("@System"); sat::Pool::instance().addRepoSolv(dir / "@System.solv", i4); } @@ -57,8 +59,7 @@ int main (int argc, const char ** argv) init_pool(); PoolQuery q; - q.addAttribute(sat::SolvAttr::name, "zypper"); - q.setEdition(Edition("0.10.5-5"), Rel::LE); + q.addAttribute(sat::SolvAttr::name, "cjson"); /* PoolQuery q; @@ -70,5 +71,8 @@ int main (int argc, const char ** argv) */ std::for_each(q.begin(), q.end(), &result_cb); // cout << q.size() << endl; - cout << q << endl; +// cout << q << endl; + cout << "=====" << endl; + for_(it, q.selectableBegin(), q.selectableEnd()) + cout << *it << endl; } diff --git a/devel/devel.jkupec/repos.cc b/devel/devel.jkupec/repos.cc index 894eb92..125f8cd 100755 --- a/devel/devel.jkupec/repos.cc +++ b/devel/devel.jkupec/repos.cc @@ -7,7 +7,7 @@ #include "zypp/RepoInfo.h" #include "zypp/Arch.h" #include "zypp/Pathname.h" -#include "zypp/RepoManager.h"; +#include "zypp/RepoManager.h" using std::cout; using std::endl; @@ -52,9 +52,8 @@ int main (int argc, const char ** argv) RepoManager rm(repo_options); - std::list repos = rm.knownRepositories(); - for ( std::list::const_iterator it = repos.begin(); - it != repos.end(); ++it ) + for ( RepoManager::RepoConstIterator it = rm.repoBegin(); + it != rm.repoEnd(); ++it ) { cout << it->packagesPath() << endl; }