- backup
authorJan Kupec <jkupec@suse.cz>
Mon, 28 Jul 2008 15:19:55 +0000 (15:19 +0000)
committerJan Kupec <jkupec@suse.cz>
Mon, 28 Jul 2008 15:19:55 +0000 (15:19 +0000)
devel/devel.jkupec/CMakeLists.txt
devel/devel.jkupec/play.cc [new file with mode: 0644]
devel/devel.jkupec/poolquery.cc
devel/devel.jkupec/repos.cc

index 56d1cc8..252665d 100644 (file)
@@ -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 (file)
index 0000000..fb5ea6d
--- /dev/null
@@ -0,0 +1,18 @@
+#include <iostream>
+
+#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;
+}
+
index d1f485f..e471807 100644 (file)
@@ -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;
 }
index 894eb92..125f8cd 100755 (executable)
@@ -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<RepoInfo> repos = rm.knownRepositories();
-  for ( std::list<RepoInfo>::const_iterator it = repos.begin();
-        it != repos.end(); ++it )
+  for ( RepoManager::RepoConstIterator it = rm.repoBegin();
+        it != rm.repoEnd(); ++it )
   {
     cout << it->packagesPath() << endl;
   }