22 #ifndef ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
23 #define ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H
24 #ifndef ZYPP_USE_RESOLVER_INTERNALS
25 #error Do not directly include this file!
29 #include <solv/solver.h>
30 #include <solv/pool.h>
75 class SATResolver :
public base::ReferenceCounted,
private base::NonCopyable,
private sat::detail::PoolMember
85 PoolItemList _problem_items;
88 PoolItemList _items_to_install;
89 PoolItemList _items_to_remove;
90 PoolItemList _items_to_lock;
91 PoolItemList _items_to_keep;
94 PoolItemList _result_items_to_install;
95 PoolItemList _result_items_to_remove;
98 bool _allowdowngrade:1;
99 bool _allownamechange:1;
100 bool _allowarchchange:1;
102 bool _allowuninstall:1;
103 bool _updatesystem:1;
104 bool _noupdateprovide:1;
105 bool _dosplitprovides:1;
106 bool _onlyRequires:1;
107 bool _ignorealreadyrecommended:1;
109 bool _distupgrade_removeunsupported:1;
114 bool _solveSrcPackages:1;
115 bool _cleandepsOnRemove:1;
119 std::string SATprobleminfoString (Id problem, std::string &detail, Id &ignoreId);
120 std::string SATproblemRuleInfoString (Id rule, std::string &detail, Id &ignoreId);
121 std::vector<std::string> SATgetCompleteProblemInfoStrings ( Id problem );
122 void resetItemTransaction (PoolItem item);
125 void solverInit(
const PoolItemList & weakItems);
134 void setSystemRequirements();
142 sat::Solvable mapSolvable (
const Id &
id);
143 PoolItem mapItem (
const PoolItem &item);
148 virtual ~SATResolver();
152 virtual std::ostream &
dumpOn( std::ostream & str )
const;
153 friend std::ostream&
operator<<(std::ostream& str,
const SATResolver & obj)
154 {
return obj.dumpOn (str); }
156 ResPool pool (
void)
const;
157 void setPool (
const ResPool & pool) { _pool = pool; }
162 const PoolItemList & weakItems,
163 const std::set<Repository> & upgradeRepos
167 const PoolItemList & weakItems
175 bool fixsystem ()
const {
return _fixsystem;}
176 void setFixsystem (
const bool fixsystem) { _fixsystem = fixsystem;}
178 bool ignorealreadyrecommended ()
const {
return _ignorealreadyrecommended;}
179 void setIgnorealreadyrecommended (
const bool ignorealreadyrecommended) { _ignorealreadyrecommended = ignorealreadyrecommended;}
181 bool distupgrade ()
const {
return _distupgrade;}
182 void setDistupgrade (
const bool distupgrade) { _distupgrade = distupgrade;}
184 bool distupgrade_removeunsupported ()
const {
return _distupgrade_removeunsupported;}
185 void setDistupgrade_removeunsupported (
const bool distupgrade_removeunsupported) { _distupgrade_removeunsupported = distupgrade_removeunsupported;}
187 bool allowdowngrade ()
const {
return _allowdowngrade;}
188 void setAllowdowngrade (
const bool allowdowngrade) { _allowdowngrade = allowdowngrade;}
190 bool allowarchchange ()
const {
return _allowarchchange;}
191 void setAllowarchchange (
const bool allowarchchange) { _allowarchchange = allowarchchange;}
194 void setAllowvendorchange (
const bool allowvendorchange) {
_allowvendorchange = allowvendorchange;}
196 bool allowuninstall ()
const {
return _allowuninstall;}
197 void setAllowuninstall (
const bool allowuninstall) { _allowuninstall = allowuninstall;}
199 bool updatesystem ()
const {
return _updatesystem;}
200 void setUpdatesystem (
const bool updatesystem) { _updatesystem = updatesystem;}
202 bool noupdateprovide ()
const {
return _noupdateprovide;}
203 void setNoupdateprovide (
const bool noupdateprovide) { _noupdateprovide = noupdateprovide;}
205 bool dosplitprovides ()
const {
return _dosplitprovides;}
206 void setDosplitprovides (
const bool dosplitprovides) { _dosplitprovides = dosplitprovides;}
208 bool onlyRequires ()
const {
return _onlyRequires;}
209 void setOnlyRequires (
const bool onlyRequires) { _onlyRequires = onlyRequires;}
211 bool solveSrcPackages()
const {
return _solveSrcPackages; }
212 void setSolveSrcPackages(
bool state_r ) { _solveSrcPackages = state_r; }
214 bool cleandepsOnRemove()
const {
return _cleandepsOnRemove; }
215 void setCleandepsOnRemove(
bool state_r ) { _cleandepsOnRemove = state_r; }
217 PoolItemList problematicUpdateItems(
void )
const {
return _problem_items; }
218 PoolItemList problematicUpdateItems() {
return _problem_items; }
220 PoolItemList resultItemsToInstall () {
return _result_items_to_install; }
221 PoolItemList resultItemsToRemove () {
return _result_items_to_remove; }
236 #endif // ZYPP_USE_RESOLVER_INTERNALS
237 #endif // ZYPP_SOLVER_DETAIL_SAT_RESOLVER_H