backup
authorMichael Andres <ma@suse.de>
Tue, 3 Apr 2007 21:24:26 +0000 (21:24 +0000)
committerMichael Andres <ma@suse.de>
Tue, 3 Apr 2007 21:24:26 +0000 (21:24 +0000)
devel/devel.ma/AOUT.cc [new file with mode: 0644]
devel/devel.ma/CMakeLists.txt
devel/devel.ma/Iorder.cc
devel/devel.ma/Parse.cc

diff --git a/devel/devel.ma/AOUT.cc b/devel/devel.ma/AOUT.cc
new file mode 100644 (file)
index 0000000..94db624
--- /dev/null
@@ -0,0 +1,51 @@
+#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;
+}
+
index 55a21e4785e3221788bb8e08ce7f1be02477338f..29df505364f43071b51bfd59132c72e37452a37e 100644 (file)
@@ -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
index 70aa78f8b2e3101e81cdaa8f02fbb7383ab111a7..5b05fd033b27e87cad80365fc3c525f48371586a 100644 (file)
@@ -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<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
 
 
@@ -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<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.
index 007d1f514fc988b9abea7cb5414f0efbacf52382..b67d9ffbdb200b141b5813eed87fd8b26e477107 100644 (file)
@@ -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<Product>() );
   showProd( prod );