libzypp  16.13.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 
27 
28 #include "zypp/ProblemTypes.h"
29 #include "zypp/ResolverProblem.h"
30 #include "zypp/ProblemSolution.h"
31 
33 namespace zypp
34 {
35 
36  namespace sat
37  {
38  class Transaction;
39  }
40 
42  //
43  // CLASS NAME : Resolver
44  //
54  {
55  public:
56 
58  Resolver( const ResPool & pool );
60  virtual ~Resolver();
61 
70  bool verifySystem();
71 
72 
87  bool resolvePool();
88 
89 
107  bool resolveQueue( solver::detail::SolverQueueItemList & queue );
108 
109  /*
110  * Undo solver changes done in resolvePool()
111  * Throwing away all ignored dependencies.
112  */
113  void undo();
114 
115  /*
116  * Resets solver information and verify option.
117  */
118  void reset();
119 
120 
134  bool doUpgrade();
135 
145  void doUpdate( );
146 
154  std::list<PoolItem> problematicUpdateItems() const;
155 
161  ResolverProblemList problems();
162 
163 
168  void applySolutions( const ProblemSolutionList & solutions );
169 
173  sat::Transaction getTransaction();
174 
180  void setForceResolve( bool force );
181  bool forceResolve() const;
182 
187  void setIgnoreAlreadyRecommended( bool yesno_r );
188  bool ignoreAlreadyRecommended() const;
189 
195  void setOnlyRequires( bool yesno_r );
196  void resetOnlyRequires(); // set back to default (described in zypp.conf)
197  bool onlyRequires() const;
198 
204  void setUpgradeMode( bool yesno_r );
205  bool upgradeMode() const;
206 
212  void setUpdateMode( bool yesno_r );
213  bool updateMode() const;
214 
215 
221  void setAllowDowngrade( bool yesno_r );
222  void setDefaultAllowDowngrade(); // Set back to default
223  bool allowDowngrade() const;
224 
226  void setAllowNameChange( bool yesno_r );
227  void setDefaultAllowNameChange(); // Set back to default
228  bool allowNameChange() const;
229 
231  void setAllowArchChange( bool yesno_r );
232  void setDefaultAllowArchChange(); // Set back to default
233  bool allowArchChange() const;
234 
238  void setAllowVendorChange( bool yesno_r );
239  void setDefaultAllowVendorChange(); // Set back to default
240  bool allowVendorChange() const;
242 
248  void setSystemVerification( bool yesno_r );
249  void setDefaultSystemVerification();
250  bool systemVerification() const;
251 
261  void setSolveSrcPackages( bool yesno_r );
262  void setDefaultSolveSrcPackages();
263  bool solveSrcPackages() const;
264 
269  void setCleandepsOnRemove( bool yesno_r );
270  void setDefaultCleandepsOnRemove(); // set back to default (in zypp.conf)
271  bool cleandepsOnRemove() const;
272 
279  void dupSetAllowDowngrade( bool yesno_r );
280  void dupSetDefaultAllowDowngrade(); // Set back to default (in zypp.conf)
281  bool dupAllowDowngrade() const;
282 
284  void dupSetAllowNameChange( bool yesno_r );
285  void dupSetDefaultAllowNameChange(); // Set back to default (in zypp.conf)
286  bool dupAllowNameChange() const;
287 
289  void dupSetAllowArchChange( bool yesno_r );
290  void dupSetDefaultAllowArchChange(); // Set back to default (in zypp.conf)
291  bool dupAllowArchChange() const;
292 
294  void dupSetAllowVendorChange( bool yesno_r );
295  void dupSetDefaultAllowVendorChange(); // Set back to default (in zypp.conf)
296  bool dupAllowVendorChange() const;
298 
310  void addUpgradeRepo( Repository repo_r );
311 
315  bool upgradingRepos() const;
316 
320  bool upgradingRepo( Repository repo_r ) const;
321 
325  void removeUpgradeRepo( Repository repo_r );
326 
330  void removeUpgradeRepos();
332 
337  void addRequire( const Capability & capability );
338 
343  void addConflict( const Capability & capability );
344 
349  void removeRequire( const Capability & capability );
350 
355  void removeConflict( const Capability & capability );
356 
361  CapabilitySet getRequire() const;
362 
367  CapabilitySet getConflict() const;
368 
375  bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true );
376 
391  solver::detail::ItemCapKindList isInstalledBy( const PoolItem & item );
392 
407  solver::detail::ItemCapKindList installs( const PoolItem & item );
408 
423  solver::detail::ItemCapKindList satifiedByInstalled( const PoolItem & item );
424 
425 
440  solver::detail::ItemCapKindList installedSatisfied( const PoolItem & item );
441 
442 
443  private:
444  friend std::ostream & operator<<( std::ostream & str, const Resolver & obj );
446  };
448 
450  std::ostream & operator<<( std::ostream & str, const Resolver & obj );
451 
453 } // namespace zypp
455 #endif // ZYPP_RESOLVER_H
std::list< ProblemSolution_Ptr > ProblemSolutionList
Definition: ProblemTypes.h:43
std::ostream & operator<<(std::ostream &str, const FileConflicts &obj)
String related utilities and Regular expression matching.
zypp::RW_pointer< solver::detail::ResolverInternal > _pimpl
Definition: Resolver.h:445
Libsolv transaction wrapper.
Definition: Transaction.h:51
std::list< SolverQueueItem_Ptr > SolverQueueItemList
Definition: Types.h:45
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
std::list< ResolverProblem_Ptr > ResolverProblemList
Definition: ProblemTypes.h:46
Dependency resolver interface.
Definition: Resolver.h:53
Base class for reference counted objects.
std::unordered_set< Capability > CapabilitySet
Definition: Capability.h:33
Global ResObject pool.
Definition: ResPool.h:60
std::list< ItemCapKind > ItemCapKindList
Definition: Types.h:41
A sat capability.
Definition: Capability.h:59
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1