Author: schubi2 Date: Thu Nov 29 14:22:20 2007 New Revision: 7978 URL: http://svn.opensuse.org/viewcvs/zypp?rev=7978&view=rev Log: bugfixes Modified: trunk/libzypp/zypp/sat/SATResolver.cc trunk/libzypp/zypp/solver/detail/Resolver.cc Modified: trunk/libzypp/zypp/sat/SATResolver.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SATResolver.cc?rev=7978&r1=7977&r2=7978&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/SATResolver.cc (original) +++ trunk/libzypp/zypp/sat/SATResolver.cc Thu Nov 29 14:22:20 2007 @@ -31,7 +31,7 @@ #include "zypp/ResFilters.h" #include "zypp/CapFilters.h" #include "zypp/sat/SATResolver.h" -#include "zypp/sat/Solvable.h" +#include "zypp/sat/Pool.h" #include "zypp/solver/detail/ProblemSolutionCombi.h" extern "C" { @@ -187,10 +187,12 @@ static void SATSolutionToPool (PoolItem_Ref item, const ResStatus & status, const ResStatus::TransactByValue causer) { +#if 0 if (triggeredSolution.find(item) != triggeredSolution.end()) { _XDEBUG("SATSolutionToPool(" << item << ") is already in the pool --> skip"); return; } +#endif triggeredSolution.insert(item); @@ -394,18 +396,7 @@ queue_push( &(jobQueue), id); } - // Searching concerning system repo - Repo *systemRepo = NULL; - for (int i = 0; i < _SATPool->nrepos; i++) - { - string compName(repo_name(_SATPool->repos[i])); - if (compName == "system") { - systemRepo = _SATPool->repos[i]; - break; - } - } - - solv = solver_create( _SATPool, systemRepo ); + solv = solver_create( _SATPool, sat::Pool::instance().systemRepo().get() ); solv->fixsystem = false; solv->updatesystem = false; solv->allowdowngrade = false; @@ -419,7 +410,6 @@ // copying solution back to zypp pool //----------------------------------------- - Id p; /* solvables to be erased */ for (int i = solv->installed->start; i < solv->installed->start + solv->installed->nsolvables; i++) @@ -429,9 +419,7 @@ PoolItem_Ref poolItem = _pool.find (sat::Solvable(i)); if (poolItem) { - ResStatus status; - status.isToBeUninstalled(); - SATSolutionToPool (poolItem, status, ResStatus::SOLVER); + SATSolutionToPool (poolItem, ResStatus::toBeUninstalled, ResStatus::SOLVER); } else { ERR << "id " << i << " not found in ZYPP pool." << endl; } @@ -440,19 +428,18 @@ /* solvables to be installed */ for (int i = 0; i < solv->decisionq.count; i++) { + Id p; p = solv->decisionq.elements[i]; - if (p < 0) + if (p < 0 || !sat::Solvable(p)) continue; - if (p >= solv->installed->start && p < solv->installed->start + solv->installed->nsolvables) + if (sat::Solvable(p).repo().get() == solv->installed) continue; PoolItem_Ref poolItem = _pool.find (sat::Solvable(p)); if (poolItem) { - ResStatus status; - status.isToBeInstalled(); - SATSolutionToPool (poolItem, status, ResStatus::SOLVER); + SATSolutionToPool (poolItem, ResStatus::toBeInstalled, ResStatus::SOLVER); } else { - ERR << "id " << p << " not found in ZYPP pool." << endl; + ERR << "id " << p << " not found in ZYPP pool." << endl; } } Modified: trunk/libzypp/zypp/solver/detail/Resolver.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver.cc?rev=7978&r1=7977&r2=7978&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/Resolver.cc (original) +++ trunk/libzypp/zypp/solver/detail/Resolver.cc Thu Nov 29 14:22:20 2007 @@ -1289,12 +1289,14 @@ // syncing with sat pool sat::Pool satPool( sat::Pool::instance() ); _pool.satSync(); +#if 0 MIL << "------SAT-Pool------" << endl; for (sat::Pool::SolvableIterator i = satPool.solvablesBegin(); i != satPool.solvablesEnd(); i++ ) { MIL << *i << " ID: " << i->id() << endl; } - MIL << "------SAT-Pool end------" << endl; + MIL << "------SAT-Pool end------" << endl; +#endif SATResolver satResolver(_pool, satPool.get()); return satResolver.resolvePool(); -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org