From: Michael Andres Date: Thu, 6 Mar 2008 12:44:43 +0000 (+0000) Subject: Do not filter any installed solvables. X-Git-Tag: BASE-SuSE-Linux-11_0-Branch~489 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf14fda56272099ccbd4e5a8b655d20e591da691;p=platform%2Fupstream%2Flibzypp.git Do not filter any installed solvables. --- diff --git a/devel/devel.ma/MaTest.cc b/devel/devel.ma/MaTest.cc index 89827ac..9bc0b50 100644 --- a/devel/devel.ma/MaTest.cc +++ b/devel/devel.ma/MaTest.cc @@ -1,60 +1,38 @@ #include - -#include -#include -#include -#include -#include - -#include "Tools.h" -#include "FakePool.h" - -#include -#include - -#include "zypp/ZYppFactory.h" -#include "zypp/ResPoolProxy.h" -#include "zypp/ResTraits.h" -#include "zypp/ResPool.h" -#include "zypp/Package.h" +#include +#include +#include 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" -/////////////////////////////////////////////////////////////////// - - diff --git a/devel/devel.ma/NewPool.cc b/devel/devel.ma/NewPool.cc index 37df821..d1eba5f 100644 --- a/devel/devel.ma/NewPool.cc +++ b/devel/devel.ma/NewPool.cc @@ -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() ); diff --git a/package/libzypp.changes b/package/libzypp.changes index 748c318..8742a69 100644 --- a/package/libzypp.changes +++ b/package/libzypp.changes @@ -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. diff --git a/zypp/Repository.cc b/zypp/Repository.cc index ec77a89..d875d75 100644 --- a/zypp/Repository.cc +++ b/zypp/Repository.cc @@ -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() ) ); } diff --git a/zypp/sat/detail/PoolImpl.cc b/zypp/sat/detail/PoolImpl.cc index 0a3dd6e..ed94975 100644 --- a/zypp/sat/detail/PoolImpl.cc +++ b/zypp/sat/detail/PoolImpl.cc @@ -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 sysids; diff --git a/zypp/sat/detail/PoolImpl.h b/zypp/sat/detail/PoolImpl.h index 8c619da..dd148c7 100644 --- a/zypp/sat/detail/PoolImpl.h +++ b/zypp/sat/detail/PoolImpl.h @@ -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 )