*/
#include <boost/static_assert.hpp>
+#define ZYPP_USE_RESOLVER_INTERNALS
+
#include "zypp/solver/detail/Resolver.h"
-#include "zypp/solver/detail/Helper.h"
#include "zypp/solver/detail/Testcase.h"
#include "zypp/solver/detail/SATResolver.h"
+#include "zypp/solver/detail/ItemCapKind.h"
+#include "zypp/solver/detail/SolutionAction.h"
+#include "zypp/solver/detail/SolverQueueItem.h"
#include "zypp/Capabilities.h"
#include "zypp/ZConfig.h"
#define MAXSOLVERRUNS 5
+using std::endl;
+using std::make_pair;
+
/////////////////////////////////////////////////////////////////////////
namespace zypp
{ ///////////////////////////////////////////////////////////////////////
namespace detail
{ ///////////////////////////////////////////////////////////////////
-using namespace std;
-
-IMPL_PTR_TYPE(Resolver);
-
+ //using namespace std;
//---------------------------------------------------------------------------
bool Resolver::ZGETTER() const \
{ return _satResolver->ZVARNAME; } \
-ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupAllowDowngrade, _dup_allowdowngrade, true )
-ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupAllowNameChange, _dup_allownamechange, true )
-ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupAllowArchChange, _dup_allowarchchange, true )
-ZOLV_FLAG_TRIBOOL( dupSetAllowVendorChange, dupAllowVendorChange, _dup_allowvendorchange, true )
+ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupAllowDowngrade, _dup_allowdowngrade, ZConfig::instance().solver_dupAllowDowngrade() )
+ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupAllowNameChange, _dup_allownamechange, ZConfig::instance().solver_dupAllowNameChange() )
+ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupAllowArchChange, _dup_allowarchchange, ZConfig::instance().solver_dupAllowArchChange() )
+ZOLV_FLAG_TRIBOOL( dupSetAllowVendorChange, dupAllowVendorChange, _dup_allowvendorchange, ZConfig::instance().solver_dupAllowVendorChange() )
#undef ZOLV_FLAG_TRIBOOL
//---------------------------------------------------------------------------
{
UndoTransact resetting (ResStatus::APPL_HIGH);
- _DEBUG ("Resolver::verifySystem() ");
+ DBG << "Resolver::verifySystem()" << endl;
_verifying = true;
void Resolver::applySolutions( const ProblemSolutionList & solutions )
{
- for_( iter, solutions.begin(), solutions.end() )
+ for ( ProblemSolution_Ptr solution : solutions )
{
- ProblemSolution_Ptr solution = *iter;
- if ( !solution->apply( *this ) )
+ if ( ! applySolution( *solution ) )
break;
}
}
+bool Resolver::applySolution( const ProblemSolution & solution )
+{
+ bool ret = true;
+ DBG << "apply solution " << solution << endl;
+ for ( SolutionAction_Ptr action : solution.actions() )
+ {
+ if ( ! action->execute( *this ) )
+ {
+ WAR << "apply solution action failed: " << action << endl;
+ ret = false;
+ break;
+ }
+ }
+ return ret;
+}
+
+//----------------------------------------------------------------------------
+
void Resolver::collectResolverInfo()
{
if ( _satResolver
&& !found) {
alreadySetForInstallation = true;
ItemCapKind capKind = pos->second;
- if (capKind.item == *instIter) found = true;
+ if (capKind.item() == *instIter) found = true;
pos++;
}
&& !found) {
alreadySetForInstallation = true;
ItemCapKind capKind = pos->second;
- if (capKind.item == *instIter) found = true;
+ if (capKind.item() == *instIter) found = true;
pos++;
}
&& !found) {
alreadySetForInstallation = true;
ItemCapKind capKind = pos->second;
- if (capKind.item == provider) found = true;
+ if (capKind.item() == provider) found = true;
pos++;
}