From a48c50383631266478958120f704a37f4b1599fd Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Tue, 3 Apr 2007 21:24:26 +0000 Subject: [PATCH] backup --- devel/devel.ma/AOUT.cc | 51 ++++++++++++++++++++++++++++++ devel/devel.ma/CMakeLists.txt | 13 +++++++- devel/devel.ma/Iorder.cc | 59 ++++------------------------------- devel/devel.ma/Parse.cc | 24 +++++++++++--- 4 files changed, 89 insertions(+), 58 deletions(-) create mode 100644 devel/devel.ma/AOUT.cc diff --git a/devel/devel.ma/AOUT.cc b/devel/devel.ma/AOUT.cc new file mode 100644 index 000000000..94db6243a --- /dev/null +++ b/devel/devel.ma/AOUT.cc @@ -0,0 +1,51 @@ +#include +#include + +#include + +#define DBG std::cout +#define MIL std::cout +#define WAR std::cerr +#define ERR std::cerr + +using std::endl; + +/////////////////////////////////////////////////////////////////// +namespace parse +{ ///////////////////////////////////////////////////////////////// + + std::string getline( std::istream & str ) + { + static const unsigned tmpBuffLen = 1024; + static char tmpBuff[tmpBuffLen]; + std::string ret; + do { + str.clear(); + str.getline( tmpBuff, tmpBuffLen ); // always writes '\0' terminated + ret += tmpBuff; + } while( str.rdstate() == std::ios::failbit ); + + return ret; + } + + ///////////////////////////////////////////////////////////////// +} // namespace parse +/////////////////////////////////////////////////////////////////// + + +/****************************************************************** +** +** FUNCTION NAME : main +** FUNCTION TYPE : int +*/ +int main( int argc, char * argv[] ) +{ + DBG << "===[START]==========================================" << endl; + + + + + DBG << "===[END]============================================" << endl; + return 0; +} + diff --git a/devel/devel.ma/CMakeLists.txt b/devel/devel.ma/CMakeLists.txt index 55a21e478..29df50536 100644 --- a/devel/devel.ma/CMakeLists.txt +++ b/devel/devel.ma/CMakeLists.txt @@ -27,7 +27,9 @@ ADD_CUSTOM_TARGET( ma_test DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ma_test ) -FOREACH( loop_var ScanSource ) +## ############################################################ + +FOREACH( loop_var ScanSource Iorder Parse ) ADD_EXECUTABLE( ${loop_var} ${loop_var}.cc ) @@ -37,6 +39,15 @@ FOREACH( loop_var ScanSource ) ENDFOREACH( loop_var ) +FOREACH( loop_var AOUT ) + ADD_EXECUTABLE( ${loop_var} + ${loop_var}.cc + ) + TARGET_LINK_LIBRARIES( ${loop_var} + boost_filesystem boost_regex + ) +ENDFOREACH( loop_var ) + FOREACH( loop_var MaTest ) ADD_EXECUTABLE( ${loop_var} ${loop_var}.cc diff --git a/devel/devel.ma/Iorder.cc b/devel/devel.ma/Iorder.cc index 70aa78f8b..5b05fd033 100644 --- a/devel/devel.ma/Iorder.cc +++ b/devel/devel.ma/Iorder.cc @@ -252,10 +252,7 @@ int main( int argc, char * argv[] ) { zypp::base::LogControl::TmpLineWriter shutUp; Source_Ref src; - src = createSource( "dir:/Local/SUSE-Linux-10.1-Build_830-i386/CD1", - "Build_830" ); - getZYpp()->addResolvables( src.resolvables() ); - src = createSource( "dir:/Local/SUSE-Linux-10.1-Build_830-Addon-BiArch/CD1", + src = createSource( "dir:/Local/dist/install/SLP/SLES-10-SP1-Build00052/i386/CD1", "Addon-BiArch" ); getZYpp()->addResolvables( src.resolvables() ); } @@ -264,10 +261,11 @@ int main( int argc, char * argv[] ) // select... for_each( pool.byKindBegin(), pool.byKindEnd(), StatusInstall() ); #define selt(K,N) selectForTransact( nameKindProxy( pool, #N ) ) - selt( Selection, default ); - selt( Package, RealPlayer ); - selt( Package, acroread ); - selt( Package, flash-player ); +// selt( Selection, default ); +// selt( Package, RealPlayer ); +// selt( Package, acroread ); +// selt( Package, flash-player ); + selt( Package, fontconfig ); #undef selt @@ -280,51 +278,6 @@ int main( int argc, char * argv[] ) typedef pool::GetResolvablesToInsDel::PoolItemList PoolItemList; - - - { - const PoolItemList & items_r( collect._toInstall ); - // prepare the package cache. - CommitPackageCache packageCache( items_r.begin(), - items_r.end(), - "/tmp", - globalSourceProvidePackage ); - unsigned snr = 0; - - for ( PoolItemList::const_iterator it = items_r.begin(); it != items_r.end(); it++ ) - { - if (isKind(it->resolvable())) - { - Package::constPtr p = asKind(it->resolvable()); - if (it->status().isToBeInstalled()) - { - ManagedFile localfile; - try - { - localfile = packageCache.get( it ); - } - catch ( const source::SkipRequestedException & e ) - { - ZYPP_CAUGHT( e ); - WAR << "Skipping package " << p << " in commit" << endl; - continue; - } - - PathInfo chk( localfile.value() ); - if ( ! chk.isFile() ) - { - ERR << "No File: " << chk << endl; - ZYPP_THROW(Exception("No File in commit")); - } - } - } - } - - } - INT << "===[END]============================================" << endl << endl; - zypp::base::LogControl::instance().logNothing(); - return 0; - if ( 1 ) { // Collect until the 1st package from an unwanted media occurs. diff --git a/devel/devel.ma/Parse.cc b/devel/devel.ma/Parse.cc index 007d1f514..b67d9ffbd 100644 --- a/devel/devel.ma/Parse.cc +++ b/devel/devel.ma/Parse.cc @@ -203,13 +203,29 @@ int main( int argc, char * argv[] ) ResPool pool( getZYpp()->pool() ); - if ( 1 ) + if ( 1 ) { + //zypp::base::LogControl::TmpLineWriter shutUp; + SourceManager::sourceManager()->restore( sysRoot ); + if ( 0 && SourceManager::sourceManager()->allSources().empty() ) { zypp::base::LogControl::TmpLineWriter shutUp; - Source_Ref src( createSource( "dir:/Local/SLES10" ) ); - getZYpp()->addResolvables( src.resolvables() ); + Source_Ref src1( createSource( "dir:/Local/SLES10" ) ); + SourceManager::sourceManager()->addSource( src1 ); + SourceManager::sourceManager()->store( sysRoot, true ); } - MIL << pool << endl; + dumpRange( USR << "Sources: ", + SourceManager::sourceManager()->Source_begin(), + SourceManager::sourceManager()->Source_end() + ) << endl; + } + //SourceManager::sourceManager()->addSource( src ); + //SourceManager::sourceManager()->store( "/", true ); + + + INT << "===[END]============================================" << endl << endl; + zypp::base::LogControl::instance().logNothing(); + return 0; + PoolItem prod( *pool.byKindBegin() ); showProd( prod ); -- 2.34.1