Author: mlandres
Date: Tue Sep 4 10:40:41 2007
New Revision: 7102
URL: http://svn.opensuse.org/viewcvs/zypp?rev=7102&view=rev
Log:
backup
Added:
trunk/libzypp/devel/devel.ma/FakePool.cc
Modified:
trunk/libzypp/devel/devel.ma/CMakeLists.txt
Modified: trunk/libzypp/devel/devel.ma/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/CMakeLists.txt?rev=7102&r1=7101&r2=7102&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.ma/CMakeLists.txt (original)
+++ trunk/libzypp/devel/devel.ma/CMakeLists.txt Tue Sep 4 10:40:41 2007
@@ -29,7 +29,7 @@
## ############################################################
-FOREACH( loop_var ScanSource Iorder Xml Main)
+FOREACH( loop_var ScanSource Iorder Xml Main FakePool AOUT Parse Test Basic)
ADD_EXECUTABLE( ${loop_var}
${loop_var}.cc
)
@@ -39,15 +39,6 @@
ENDFOREACH( loop_var )
-FOREACH( loop_var AOUT Parse Test Basic)
- ADD_EXECUTABLE( ${loop_var}
- ${loop_var}.cc
- )
- TARGET_LINK_LIBRARIES( ${loop_var}
- zypp
- )
-ENDFOREACH( loop_var )
-
FOREACH( loop_var MaTest )
ADD_EXECUTABLE( ${loop_var}
${loop_var}.cc
Added: trunk/libzypp/devel/devel.ma/FakePool.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/FakePool.cc?rev=7102&view=auto
==============================================================================
--- trunk/libzypp/devel/devel.ma/FakePool.cc (added)
+++ trunk/libzypp/devel/devel.ma/FakePool.cc Tue Sep 4 10:40:41 2007
@@ -0,0 +1,84 @@
+#include "Tools.h"
+#include "Tools.h"
+
+#include <iostream>
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include "zypp/ResPoolProxy.h"
+
+using namespace std;
+using namespace zypp;
+using namespace zypp::ui;
+
+bool chst( Selectable::Ptr & sel, Status status )
+{
+ DBG << "+++ " << sel << endl;
+ Status ostatus( sel->status() );
+ bool res = sel->set_status( status );
+ (res?MIL:WAR) << ostatus << " -> " << status << " ==>(" << res << ") " << sel->status() << endl;
+ DBG << "--- " << sel << endl;
+ return res;
+}
+
+/******************************************************************
+**
+** FUNCTION NAME : main
+** FUNCTION TYPE : int
+*/
+int main( int argc, char * argv[] )
+{
+ INT << "===[START]==========================================" << endl;
+
+ const char *const lines[] = {
+ "@ package",
+ "@ installed",
+ "- foo 1 1 i686",
+ "@ available",
+ "- foo 2 1 i686",
+ "@ fin"
+ };
+
+ debug::addPool( lines, lines+(sizeof(lines)/sizeof(const char *const)) );
+
+ ResPool pool( getZYpp()->pool() );
+ ResPoolProxy uipool( getZYpp()->poolProxy() );
+
+ USR << pool << endl;
+ USR << uipool << endl;
+
+ //for_each( pool.begin(), pool.end(), Print() );
+
+ Selectable::Ptr sel( *uipool.byKindBegin<Package>() );
+
+/* enum Status
+ {
+ S_Protected, // Keep this unmodified ( have installedObj && S_Protected )
+ S_Taboo, // Keep this unmodified ( have no installedObj && S_Taboo)
+ // requested by user:
+ S_Del, // delete installedObj ( clears S_Protected if set )
+ S_Update, // install candidateObj ( have installedObj, clears S_Protected if set )
+ S_Install, // install candidateObj ( have no installedObj, clears S_Taboo if set )
+ // not requested by user:
+ S_AutoDel, // delete installedObj
+ S_AutoUpdate, // install candidateObj ( have installedObj )
+ S_AutoInstall, // install candidateObj ( have no installedObj )
+ // no modification:
+ S_KeepInstalled, // no modification ( have installedObj && !S_Protected, clears S_Protected if set )
+ S_NoInst, // no modification ( have no installedObj && !S_Taboo, clears S_Taboo if set )
+ };
+*/
+ MIL << sel << endl;
+ chst( sel, ui::S_Update );
+ chst( sel, ui::S_Install );
+ chst( sel, ui::S_Protected );
+ chst( sel, ui::S_KeepInstalled );
+
+ INT << "===[END]============================================" << endl
+ << endl;
+ return 0;
+}
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org