Do not filter any installed solvables.
authorMichael Andres <ma@suse.de>
Thu, 6 Mar 2008 12:44:43 +0000 (12:44 +0000)
committerMichael Andres <ma@suse.de>
Thu, 6 Mar 2008 12:44:43 +0000 (12:44 +0000)
devel/devel.ma/MaTest.cc
devel/devel.ma/NewPool.cc
package/libzypp.changes
zypp/Repository.cc
zypp/sat/detail/PoolImpl.cc
zypp/sat/detail/PoolImpl.h

index 89827ac..9bc0b50 100644 (file)
@@ -1,60 +1,38 @@
 #include <iostream>
-
-#include <qapplication.h>
-#include <qpushbutton.h>
-#include <qlistview.h>
-#include <qvbox.h>
-#include <qdir.h>
-
-#include "Tools.h"
-#include "FakePool.h"
-
-#include <zypp/base/PtrTypes.h>
-#include <zypp/base/Exception.h>
-
-#include "zypp/ZYppFactory.h"
-#include "zypp/ResPoolProxy.h"
-#include "zypp/ResTraits.h"
-#include "zypp/ResPool.h"
-#include "zypp/Package.h"
+#include <zypp/base/LogTools.h>
+#include <zypp/base/Easy.h>
+#include <zypp/sat/Pool.h>
 
 using std::endl;
+using std::cout;
 using namespace zypp;
 
-///////////////////////////////////////////////////////////////////
-
-void setup( QVBox & top, int argc, char **argv )
+/******************************************************************
+**
+**      FUNCTION NAME : main
+**      FUNCTION TYPE : int
+*/
+int main( int argc, const char * argv[] )
 {
-  if ( ! argc )
-    return;
-
-  MIL << argv[0] << endl;
+  --argc; ++argv; // skip arg 0
+  sat::Pool satpool( sat::Pool::instance() );
+
+  for ( ; argc;  --argc, ++argv )
+  {
+    cout << "Read: " << argv[0] << endl;
+    satpool.addRepoSolv( argv[0] );
+  }
+
+  cout << "Done: " << satpool << endl;
+
+  if ( getenv("VERBOSE") )
+  {
+    for_( it, satpool.solvablesBegin(), satpool.solvablesEnd() )
+    {
+      cout << dump(*it) << endl;
+    }
+  }
+
+  return 0;
 }
 
-///////////////////////////////////////////////////////////////////
-
-int main( int argc, char **argv )
-{
-  base::LogControl::instance().logfile( "-" );
-  INT << "===[START]==========================================" << endl;
-
-  QApplication app( argc, argv );
-  QVBox        top;
-
-  --argc;
-  ++argv;
-  setup( top, argc, argv );
-
-  QPushButton quit( "Quit", &top );
-  QObject::connect( &quit,SIGNAL(clicked()), &app, SLOT(quit()) );
-  app.setMainWidget( &top );
-  top.show();
-  INT << "===[LOOP]==========================================" << endl;
-  return app.exec();
-}
-
-///////////////////////////////////////////////////////////////////
-//#include "QPool.moc"
-///////////////////////////////////////////////////////////////////
-
-
index 37df821..d1eba5f 100644 (file)
@@ -443,7 +443,7 @@ namespace zypp
 */
 int main( int argc, char * argv[] )
 try {
-  //zypp::base::LogControl::instance().logfile( "log.restrict" );
+  zypp::base::LogControl::instance().logToStdErr();
   INT << "===[START]==========================================" << endl;
 
   sat::Pool satpool( sat::Pool::instance() );
index 748c318..8742a69 100644 (file)
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Thu Mar  6 13:42:53 CET 2008 - ma@suse.de
+
+- Do not filter any installed solvables.
+- revision 9031
+
+-------------------------------------------------------------------
 Wed Mar  5 11:33:26 CET 2008 - ma@suse.de
        
 - Try to rebuild broken solv files in Target::load.
index ec77a89..d875d75 100644 (file)
@@ -132,7 +132,7 @@ namespace zypp
            ZYPP_THROW( Exception( _("Can't open solv-file: ")+file_r.asString() ) );
        }
 
-       if ( myPool()._addSolv( _repo, file ) != 0 )
+       if ( myPool()._addSolv( _repo, file, isSystemRepo() ) != 0 )
        {
            ZYPP_THROW( Exception( _("Error reading solv-file: ")+file_r.asString() ) );
        }
index 0a3dd6e..ed94975 100644 (file)
@@ -94,6 +94,7 @@ namespace zypp
       PoolImpl::PoolImpl()
       : _pool( ::pool_create() )
       {
+        MIL << "Creating sat-pool." << endl;
         if ( ! _pool )
         {
           ZYPP_THROW( Exception( _("Can not create sat-pool.") ) );
@@ -103,9 +104,6 @@ namespace zypp
         ::pool_setdebuglevel( _pool, verbose ? 5 : 1 );
         ::pool_setdebugcallback( _pool, logSat, NULL );
 
-        // set pool architecture
-        ::pool_setarch( _pool,  ZConfig::instance().systemArchitecture().asString().c_str() );
-
         // set namespace callback
         _pool->nscallback = &nsCallback;
         _pool->nscallbackdata = (void*)this;
@@ -153,8 +151,8 @@ namespace zypp
       {
         if ( _watcher.remember( _serial ) )
         {
-          /* nothing to do here, but _watcher MUST remember... */
-         // set pool architecture
+          // After repo/solvable add/remove:
+          // set pool architecture
           ::pool_setarch( _pool,  ZConfig::instance().systemArchitecture().asString().c_str() );
         }
         if ( ! _pool->whatprovides )
@@ -167,11 +165,11 @@ namespace zypp
 
       ///////////////////////////////////////////////////////////////////
 
-      int PoolImpl::_addSolv( ::_Repo * repo_r, FILE * file_r )
+      int PoolImpl::_addSolv( ::_Repo * repo_r, FILE * file_r, bool isSystemRepo_r )
       {
         setDirty(__FUNCTION__, repo_r->name );
         int ret = ::repo_add_solv( repo_r , file_r  );
-        if ( ret == 0 )
+        if ( ret == 0 && ! isSystemRepo_r )
         {
           // Filter out unwanted archs
           std::set<detail::IdType> sysids;
index 8c619da..dd148c7 100644 (file)
@@ -101,8 +101,11 @@ namespace zypp
             eraseRepoInfo( repo_r );
           }
 
-          /** Adding solv file to a repo. */
-          int _addSolv( ::_Repo * repo_r, FILE * file_r );
+          /** Adding solv file to a repo.
+           * Except for \c isSystemRepo_r, solvables of incompatible architecture
+           * are filtered out.
+          */
+          int _addSolv( ::_Repo * repo_r, FILE * file_r, bool isSystemRepo_r = false );
 
           /** Adding Solvables to a repo. */
           detail::SolvableIdType _addSolvables( ::_Repo * repo_r, unsigned count_r )