6 #include <zypp/base/LogControl.h>
7 #include <zypp/base/LogTools.h>
8 #include <zypp/base/String.h>
9 #include <zypp/base/SerialNumber.h>
10 #include <zypp/PathInfo.h>
11 #include <zypp/TmpPath.h>
12 #include "zypp/ResPoolProxy.h"
16 using namespace zypp::ui;
18 bool chst( Selectable::Ptr & sel, Status status )
20 DBG << "+++ " << sel << endl;
21 Status ostatus( sel->status() );
22 bool res = sel->set_status( status );
23 (res?MIL:WAR) << ostatus << " -> " << status << " ==>(" << res << ") " << sel->status() << endl;
24 DBG << "--- " << sel << endl;
28 /******************************************************************
30 ** FUNCTION NAME : main
31 ** FUNCTION TYPE : int
33 int main( int argc, char * argv[] )
35 INT << "===[START]==========================================" << endl;
37 const char *const lines[] = {
46 debug::addPool( lines, lines+(sizeof(lines)/sizeof(const char *const)) );
48 ResPool pool( getZYpp()->pool() );
49 ResPoolProxy uipool( getZYpp()->poolProxy() );
52 USR << uipool << endl;
54 //for_each( pool.begin(), pool.end(), Print() );
56 Selectable::Ptr sel( *uipool.byKindBegin<Package>() );
60 S_Protected, // Keep this unmodified ( have installedObj && S_Protected )
61 S_Taboo, // Keep this unmodified ( have no installedObj && S_Taboo)
63 S_Del, // delete installedObj ( clears S_Protected if set )
64 S_Update, // install candidateObj ( have installedObj, clears S_Protected if set )
65 S_Install, // install candidateObj ( have no installedObj, clears S_Taboo if set )
66 // not requested by user:
67 S_AutoDel, // delete installedObj
68 S_AutoUpdate, // install candidateObj ( have installedObj )
69 S_AutoInstall, // install candidateObj ( have no installedObj )
71 S_KeepInstalled, // no modification ( have installedObj && !S_Protected, clears S_Protected if set )
72 S_NoInst, // no modification ( have no installedObj && !S_Taboo, clears S_Taboo if set )
76 chst( sel, ui::S_Update );
77 chst( sel, ui::S_Install );
78 chst( sel, ui::S_Protected );
79 chst( sel, ui::S_KeepInstalled );
81 INT << "===[END]============================================" << endl