Author: schubi2 Date: Tue Jan 15 16:50:23 2008 New Revision: 8292 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8292&view=rev Log: enable require,conflicts jobs in the SAT-solver Modified: trunk/libzypp/zypp/sat/SATResolver.cc trunk/libzypp/zypp/sat/SATResolver.h 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=8292&r1=8291&r2=8292&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/SATResolver.cc (original) +++ trunk/libzypp/zypp/sat/SATResolver.cc Tue Jan 15 16:50:23 2008 @@ -381,7 +381,8 @@ bool -SATResolver::resolvePool() +SATResolver::resolvePool(const CapSet & requires_caps, + const CapSet & conflict_caps) { SATCollectTransact info (*this); MIL << "SATResolver::resolvePool()" << endl; @@ -427,6 +428,19 @@ queue_push( &(jobQueue), SOLVER_ERASE_SOLVABLE_NAME ); queue_push( &(jobQueue), s->name); } + + for (CapSet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) { + queue_push( &(jobQueue), SOLVER_INSTALL_SOLVABLE_PROVIDES ); + queue_push( &(jobQueue), str2id( _SATPool, (iter->asString()).c_str(), 1 ) ); + MIL << "Requires " << iter->asString() << endl; + } + + for (CapSet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) { + queue_push( &(jobQueue), SOLVER_ERASE_SOLVABLE_PROVIDES); + queue_push( &(jobQueue), str2id( _SATPool, (iter->asString()).c_str(), 1 )); + MIL << "Conflicts " << iter->asString() << endl; + } + solv = solver_create( _SATPool, sat::Pool::instance().systemRepo().get() ); sat::Pool::instance().setDirty(); sat::Pool::instance().prepare(); Modified: trunk/libzypp/zypp/sat/SATResolver.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/SATResolver.h?rev=8292&r1=8291&r2=8292&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/SATResolver.h (original) +++ trunk/libzypp/zypp/sat/SATResolver.h Tue Jan 15 16:50:23 2008 @@ -34,6 +34,7 @@ #include "zypp/ProblemTypes.h" #include "zypp/ResolverProblem.h" #include "zypp/ProblemSolution.h" +#include "zypp/CapSet.h" extern "C" { #include "satsolver/solver.h" #include "satsolver/pool.h" @@ -98,7 +99,8 @@ ResPool pool (void) const; void setPool (const ResPool & pool) { _pool = pool; } - bool resolvePool(); + bool resolvePool(const CapSet & requires_caps, + const CapSet & conflict_caps); ResolverProblemList problems (); void applySolutions (const ProblemSolutionList &solutions); Modified: trunk/libzypp/zypp/solver/detail/Resolver.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/solver/detail/Resolver.cc?rev=8292&r1=8291&r2=8292&view=diff ============================================================================== --- trunk/libzypp/zypp/solver/detail/Resolver.cc (original) +++ trunk/libzypp/zypp/solver/detail/Resolver.cc Tue Jan 15 16:50:23 2008 @@ -1326,7 +1326,7 @@ } MIL << "------SAT-Pool end------" << endl; #endif - return _satResolver->resolvePool(); + return _satResolver->resolvePool (_extra_caps, _extra_conflicts); } ResolverContext_Ptr saveContext = _best_context; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org