--- /dev/null
+#include <iostream>
+#include <fstream>
+
+#include <boost/filesystem/path.hpp>
+
+#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;
+}
+
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ma_test
)
-FOREACH( loop_var ScanSource )
+## ############################################################
+
+FOREACH( loop_var ScanSource Iorder Parse )
ADD_EXECUTABLE( ${loop_var}
${loop_var}.cc
)
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
{
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() );
}
// select...
for_each( pool.byKindBegin<Product>(), pool.byKindEnd<Product>(), StatusInstall() );
#define selt(K,N) selectForTransact( nameKindProxy<K>( 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
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<Package>(it->resolvable()))
- {
- Package::constPtr p = asKind<Package>(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.
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<Product>() );
showProd( prod );