libzypp  17.14.0
Resolver.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #ifndef ZYPP_RESOLVER_H
13 #define ZYPP_RESOLVER_H
14 
15 #include <iosfwd>
16 #include <functional>
17 
19 #include "zypp/base/PtrTypes.h"
20 
21 #include "zypp/ResPool.h"
22 #include "zypp/PoolItem.h"
23 #include "zypp/Capabilities.h"
24 #include "zypp/Capability.h"
25 #include "zypp/ResolverNamespace.h"
26 
28 
29 #include "zypp/ProblemTypes.h"
30 #include "zypp/ResolverProblem.h"
31 #include "zypp/ProblemSolution.h"
32 
34 namespace zypp
35 {
36 
37  namespace sat
38  {
39  class Transaction;
40  }
41 
43  //
44  // CLASS NAME : Resolver
45  //
55  {
56  public:
57 
59  Resolver( const ResPool & pool );
61  virtual ~Resolver();
62 
71  bool verifySystem();
72 
73 
88  bool resolvePool();
89 
90 
109 
110  /*
111  * Undo solver changes done in resolvePool()
112  * Throwing away all ignored dependencies.
113  */
114  void undo();
115 
116  /*
117  * Resets solver information and verify option.
118  */
119  void reset();
120 
121 
135  bool doUpgrade();
136 
146  void doUpdate( );
147 
155  std::list<PoolItem> problematicUpdateItems() const;
156 
163 
164 
169  void applySolutions( const ProblemSolutionList & solutions );
170 
175 
181  void setForceResolve( bool force );
182  bool forceResolve() const;
183 
188  void setIgnoreAlreadyRecommended( bool yesno_r );
189  bool ignoreAlreadyRecommended() const;
190 
196  void setOnlyRequires( bool yesno_r );
197  void resetOnlyRequires(); // set back to default (described in zypp.conf)
198  bool onlyRequires() const;
199 
205  void setUpgradeMode( bool yesno_r );
206  bool upgradeMode() const;
207 
213  void setUpdateMode( bool yesno_r );
214  bool updateMode() const;
215 
216 
222  void setAllowDowngrade( bool yesno_r );
223  void setDefaultAllowDowngrade(); // Set back to default
224  bool allowDowngrade() const;
225 
227  void setAllowNameChange( bool yesno_r );
228  void setDefaultAllowNameChange(); // Set back to default
229  bool allowNameChange() const;
230 
232  void setAllowArchChange( bool yesno_r );
233  void setDefaultAllowArchChange(); // Set back to default
234  bool allowArchChange() const;
235 
239  void setAllowVendorChange( bool yesno_r );
240  void setDefaultAllowVendorChange(); // Set back to default
241  bool allowVendorChange() const;
243 
249  void setSystemVerification( bool yesno_r );
251  bool systemVerification() const;
252 
262  void setSolveSrcPackages( bool yesno_r );
264  bool solveSrcPackages() const;
265 
270  void setCleandepsOnRemove( bool yesno_r );
271  void setDefaultCleandepsOnRemove(); // set back to default (in zypp.conf)
272  bool cleandepsOnRemove() const;
273 
280  void dupSetAllowDowngrade( bool yesno_r );
281  void dupSetDefaultAllowDowngrade(); // Set back to default (in zypp.conf)
282  bool dupAllowDowngrade() const;
283 
285  void dupSetAllowNameChange( bool yesno_r );
286  void dupSetDefaultAllowNameChange(); // Set back to default (in zypp.conf)
287  bool dupAllowNameChange() const;
288 
290  void dupSetAllowArchChange( bool yesno_r );
291  void dupSetDefaultAllowArchChange(); // Set back to default (in zypp.conf)
292  bool dupAllowArchChange() const;
293 
295  void dupSetAllowVendorChange( bool yesno_r );
296  void dupSetDefaultAllowVendorChange(); // Set back to default (in zypp.conf)
297  bool dupAllowVendorChange() const;
299 
311  void addUpgradeRepo( Repository repo_r );
312 
316  bool upgradingRepos() const;
317 
321  bool upgradingRepo( Repository repo_r ) const;
322 
326  void removeUpgradeRepo( Repository repo_r );
327 
331  void removeUpgradeRepos();
333 
338  void addRequire( const Capability & capability );
339 
344  void addConflict( const Capability & capability );
345 
350  void removeRequire( const Capability & capability );
351 
356  void removeConflict( const Capability & capability );
357 
362  CapabilitySet getRequire() const;
363 
368  CapabilitySet getConflict() const;
369 
376  bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true );
377 
393 
409 
425 
426 
442 
443 
444  private:
445  friend std::ostream & operator<<( std::ostream & str, const Resolver & obj );
447  };
449 
451  std::ostream & operator<<( std::ostream & str, const Resolver & obj );
452 
454 } // namespace zypp
456 #endif // ZYPP_RESOLVER_H