#ifndef ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
#define ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
-
+#ifndef ZYPP_USE_RESOLVER_INTERNALS
+#error Do not directly include this file!
+#else
extern "C"
{
#include <solv/solver.h>
#include "zypp/Capability.h"
#include "zypp/solver/detail/SolverQueueItem.h"
+#include "zypp/sat/detail/PoolMember.h"
+
/////////////////////////////////////////////////////////////////////////
namespace zypp
{ ///////////////////////////////////////////////////////////////////////
* via solver::detail::Resolver to SATResolver is pedestrian and error prone.
* Introdce a dedicated solver option structure which is passed down as a whole.
*/
-class SATResolver : public base::ReferenceCounted, private base::NonCopyable {
+class SATResolver : public base::ReferenceCounted, private base::NonCopyable, private sat::detail::PoolMember
+{
private:
ResPool _pool;
- Pool *_SATPool;
- Solver *_solv;
- Queue _jobQueue;
+ sat::detail::CPool *_satPool;
+ sat::detail::CSolver *_satSolver;
+ sat::detail::CQueue _jobQueue;
// list of problematic items (orphaned)
PoolItemList _problem_items;
// solve results
PoolItemList _result_items_to_install;
PoolItemList _result_items_to_remove;
+ public:
+ bool _fixsystem:1; // repair errors in rpm dependency graph
+ bool _allowdowngrade:1; // allow to downgrade installed solvable
+ bool _allowarchchange:1; // allow to change architecture of installed solvables
+ bool _allowvendorchange:1; // allow to change vendor of installed solvables
+ bool _allowuninstall:1; // allow removal of installed solvables
+ bool _updatesystem:1; // update
+ bool _noupdateprovide:1; // true: update packages needs not to provide old package
+ bool _dosplitprovides:1; // true: consider legacy split provides
+ bool _onlyRequires:1; // true: consider required packages only
+ bool _ignorealreadyrecommended:1; // true: ignore recommended packages that were already recommended by the installed packages
+ bool _distupgrade:1;
+ bool _distupgrade_removeunsupported:1;
+ bool _dup_allowdowngrade:1; // dup mode: allow to downgrade installed solvable
+ bool _dup_allownamechange:1; // dup mode: allow to change name of installed solvable
+ bool _dup_allowarchchange:1; // dup mode: allow to change architecture of installed solvables
+ bool _dup_allowvendorchange:1; // dup mode: allow to change vendor of installed solvables
+ bool _solveSrcPackages:1; // false: generate no job rule for source packages selected in the pool
+ bool _cleandepsOnRemove:1; // whether removing a package should also remove no longer needed requirements
- bool _fixsystem; // repair errors in rpm dependency graph
- bool _allowdowngrade; // allow to downgrade installed solvable
- bool _allowarchchange; // allow to change architecture of installed solvables
- bool _allowvendorchange; // allow to change vendor of installed solvables
- bool _allowuninstall; // allow removal of installed solvables
- bool _updatesystem; // update
- bool _noupdateprovide; // true: update packages needs not to provide old package
- bool _dosplitprovides; // true: consider legacy split provides
- bool _onlyRequires; // true: consider required packages only
- bool _ignorealreadyrecommended; // true: ignore recommended packages that were already recommended by the installed packages
- bool _distupgrade;
- bool _distupgrade_removeunsupported;
- bool _solveSrcPackages; // false: generate no job rule for source packages selected in the pool
- bool _cleandepsOnRemove; // whether removing a package should also remove no longer needed requirements
-
+ private:
// ---------------------------------- methods
std::string SATprobleminfoString (Id problem, std::string &detail, Id &ignoreId);
void resetItemTransaction (PoolItem item);
public:
- SATResolver (const ResPool & pool, Pool *SATPool);
+ SATResolver (const ResPool & pool, sat::detail::CPool *satPool);
virtual ~SATResolver();
// ---------------------------------- I/O
ResolverProblemList problems ();
void applySolutions (const ProblemSolutionList &solutions);
- void addPoolItemToInstall (PoolItem item);
- void addPoolItemsToInstallFromList (PoolItemList & rl);
-
- void addPoolItemToLock (PoolItem item);
- void addPoolItemToKeep (PoolItem item);
-
- void addPoolItemToRemove (PoolItem item);
- void addPoolItemsToRemoveFromList (PoolItemList & rl);
-
bool fixsystem () const {return _fixsystem;}
void setFixsystem ( const bool fixsystem) { _fixsystem = fixsystem;}
void setCleandepsOnRemove( bool state_r ) { _cleandepsOnRemove = state_r; }
PoolItemList problematicUpdateItems( void ) const { return _problem_items; }
+ PoolItemList problematicUpdateItems() { return _problem_items; }
PoolItemList resultItemsToInstall () { return _result_items_to_install; }
PoolItemList resultItemsToRemove () { return _result_items_to_remove; }
- PoolItemList problematicUpdateItems() { return _problem_items; }
sat::StringQueue autoInstalled() const;
sat::StringQueue userInstalled() const;
///////////////////////////////////////////////////////////////////////
};// namespace zypp
/////////////////////////////////////////////////////////////////////////
-
+#endif // ZYPP_USE_RESOLVER_INTERNALS
#endif // ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H