libzypp  16.22.9
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 
20 #include "zypp/solver/Types.h"
22 
24 namespace zypp
25 {
26 
27  namespace sat
28  {
29  class Transaction;
30  }
31 
33  //
34  // CLASS NAME : Resolver
35  //
45  {
46  public:
47 
49  Resolver( const ResPool & pool );
51  virtual ~Resolver();
52 
61  bool verifySystem();
62 
63 
78  bool resolvePool();
79 
80 
98  bool resolveQueue( solver::detail::SolverQueueItemList & queue );
99 
100  /*
101  * Undo solver changes done in resolvePool()
102  * Throwing away all ignored dependencies.
103  */
104  void undo();
105 
106  /*
107  * Resets solver information and verify option.
108  */
109  void reset();
110 
111 
125  bool doUpgrade();
126 
136  void doUpdate( );
137 
145  std::list<PoolItem> problematicUpdateItems() const;
146 
152  ResolverProblemList problems();
153 
154 
159  void applySolutions( const ProblemSolutionList & solutions );
160 
164  sat::Transaction getTransaction();
165 
170  void setFocus( ResolverFocus focus_r );
171  ResolverFocus focus() const;
172 
178  void setForceResolve( bool force );
179  bool forceResolve() const;
180 
185  void setIgnoreAlreadyRecommended( bool yesno_r );
186  bool ignoreAlreadyRecommended() const;
187 
193  void setOnlyRequires( bool yesno_r );
194  void resetOnlyRequires(); // set back to default (described in zypp.conf)
195  bool onlyRequires() const;
196 
202  void setUpgradeMode( bool yesno_r );
203  bool upgradeMode() const;
204 
210  void setUpdateMode( bool yesno_r );
211  bool updateMode() const;
212 
213 
219  void setAllowDowngrade( bool yesno_r );
220  void setDefaultAllowDowngrade(); // Set back to default
221  bool allowDowngrade() const;
222 
224  void setAllowNameChange( bool yesno_r );
225  void setDefaultAllowNameChange(); // Set back to default
226  bool allowNameChange() const;
227 
229  void setAllowArchChange( bool yesno_r );
230  void setDefaultAllowArchChange(); // Set back to default
231  bool allowArchChange() const;
232 
236  void setAllowVendorChange( bool yesno_r );
237  void setDefaultAllowVendorChange(); // Set back to default
238  bool allowVendorChange() const;
240 
246  void setSystemVerification( bool yesno_r );
247  void setDefaultSystemVerification();
248  bool systemVerification() const;
249 
259  void setSolveSrcPackages( bool yesno_r );
260  void setDefaultSolveSrcPackages();
261  bool solveSrcPackages() const;
262 
267  void setCleandepsOnRemove( bool yesno_r );
268  void setDefaultCleandepsOnRemove(); // set back to default (in zypp.conf)
269  bool cleandepsOnRemove() const;
270 
277  void dupSetAllowDowngrade( bool yesno_r );
278  void dupSetDefaultAllowDowngrade(); // Set back to default (in zypp.conf)
279  bool dupAllowDowngrade() const;
280 
282  void dupSetAllowNameChange( bool yesno_r );
283  void dupSetDefaultAllowNameChange(); // Set back to default (in zypp.conf)
284  bool dupAllowNameChange() const;
285 
287  void dupSetAllowArchChange( bool yesno_r );
288  void dupSetDefaultAllowArchChange(); // Set back to default (in zypp.conf)
289  bool dupAllowArchChange() const;
290 
292  void dupSetAllowVendorChange( bool yesno_r );
293  void dupSetDefaultAllowVendorChange(); // Set back to default (in zypp.conf)
294  bool dupAllowVendorChange() const;
296 
308  void addUpgradeRepo( Repository repo_r );
309 
313  bool upgradingRepos() const;
314 
318  bool upgradingRepo( Repository repo_r ) const;
319 
323  void removeUpgradeRepo( Repository repo_r );
324 
328  void removeUpgradeRepos();
330 
335  void addRequire( const Capability & capability );
336 
341  void addConflict( const Capability & capability );
342 
347  void removeRequire( const Capability & capability );
348 
353  void removeConflict( const Capability & capability );
354 
359  CapabilitySet getRequire() const;
360 
365  CapabilitySet getConflict() const;
366 
373  bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true );
374 
389  solver::detail::ItemCapKindList isInstalledBy( const PoolItem & item );
390 
405  solver::detail::ItemCapKindList installs( const PoolItem & item );
406 
421  solver::detail::ItemCapKindList satifiedByInstalled( const PoolItem & item );
422 
423 
438  solver::detail::ItemCapKindList installedSatisfied( const PoolItem & item );
439 
440 
441  private:
442  friend std::ostream & operator<<( std::ostream & str, const Resolver & obj );
444  };
446 
448  std::ostream & operator<<( std::ostream & str, const Resolver & obj );
449 
451 } // namespace zypp
453 #endif // ZYPP_RESOLVER_H
std::list< ProblemSolution_Ptr > ProblemSolutionList
Definition: ProblemTypes.h:43
Common types used in the Resolver public API and need to be passed down to the details tree...
ResolverFocus
The resolvers general attitude.
Definition: ResolverFocus.h:21
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:443
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:44
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