libzypp  16.2.1
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 
215  void setAllowVendorChange( bool yesno_r );
216  void setDefaultAllowVendorChange(); // set back to default (in zypp.conf)
217  bool allowVendorChange() const;
218 
224  void setSystemVerification( bool yesno_r );
225  void setDefaultSystemVerification();
226  bool systemVerification() const;
227 
237  void setSolveSrcPackages( bool yesno_r );
238  void setDefaultSolveSrcPackages();
239  bool solveSrcPackages() const;
240 
245  void setCleandepsOnRemove( bool yesno_r );
246  void setDefaultCleandepsOnRemove(); // set back to default (in zypp.conf)
247  bool cleandepsOnRemove() const;
248 
255  void dupSetAllowDowngrade( bool yesno_r );
256  void dupSetDefaultAllowDowngrade(); // Set back to default (in zypp.conf)
257  bool dupAllowDowngrade() const;
258 
260  void dupSetAllowNameChange( bool yesno_r );
261  void dupSetDefaultAllowNameChange(); // Set back to default (in zypp.conf)
262  bool dupAllowNameChange() const;
263 
265  void dupSetAllowArchChange( bool yesno_r );
266  void dupSetDefaultAllowArchChange(); // Set back to default (in zypp.conf)
267  bool dupAllowArchChange() const;
268 
270  void dupSetAllowVendorChange( bool yesno_r );
271  void dupSetDefaultAllowVendorChange(); // Set back to default (in zypp.conf)
272  bool dupAllowVendorChange() const;
274 
286  void addUpgradeRepo( Repository repo_r );
287 
291  bool upgradingRepo( Repository repo_r ) const;
292 
296  void removeUpgradeRepo( Repository repo_r );
297 
301  void removeUpgradeRepos();
303 
308  void addRequire( const Capability & capability );
309 
314  void addConflict( const Capability & capability );
315 
320  void removeRequire( const Capability & capability );
321 
326  void removeConflict( const Capability & capability );
327 
332  CapabilitySet getRequire() const;
333 
338  CapabilitySet getConflict() const;
339 
346  bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true );
347 
362  solver::detail::ItemCapKindList isInstalledBy( const PoolItem & item );
363 
378  solver::detail::ItemCapKindList installs( const PoolItem & item );
379 
394  solver::detail::ItemCapKindList satifiedByInstalled( const PoolItem & item );
395 
396 
411  solver::detail::ItemCapKindList installedSatisfied( const PoolItem & item );
412 
413 
414  private:
415  friend std::ostream & operator<<( std::ostream & str, const Resolver & obj );
417  };
419 
421  std::ostream & operator<<( std::ostream & str, const Resolver & obj );
422 
424 } // namespace zypp
426 #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:416
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