libzypp  17.37.5
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  ~Resolver() override;
52 
64  void setDefaultSolverFlags( bool all_r = true );
65 
74  bool verifySystem();
75 
76 
91  bool resolvePool();
92 
93 
111  bool resolveQueue( solver::detail::SolverQueueItemList & queue );
112 
113  /*
114  * Undo solver changes done in resolvePool()
115  * Throwing away all ignored dependencies.
116  */
117  void undo();
118 
119  /*
120  * Resets solver information and verify option.
121  */
122  void reset();
123 
124 
138  bool doUpgrade();
139 
149  void doUpdate( );
150 
158  std::list<PoolItem> problematicUpdateItems() const;
159 
165  ResolverProblemList problems();
166 
167 
172  void applySolutions( const ProblemSolutionList & solutions );
173 
177  sat::Transaction getTransaction();
178 
183  void setFocus( ResolverFocus focus_r );
184  ResolverFocus focus() const;
185 
191  void setForceResolve( bool force );
192  bool forceResolve() const;
193 
198  void setIgnoreAlreadyRecommended( bool yesno_r );
199  bool ignoreAlreadyRecommended() const;
200 
206  void setOnlyRequires( bool yesno_r );
207  void resetOnlyRequires(); // set back to default (described in zypp.conf)
208  bool onlyRequires() const;
209 
215  void setUpgradeMode( bool yesno_r );
216  bool upgradeMode() const;
217 
223  void setUpdateMode( bool yesno_r );
224  bool updateMode() const;
225 
240  void setRemoveOrphaned( bool yesno_r );
241  bool removeOrphaned() const;
242 
256  void setRemoveUnneeded( bool yesno_r );
257  bool removeUnneeded() const;
258 
264  void setAllowDowngrade( bool yesno_r );
265  void setDefaultAllowDowngrade(); // Set back to default
266  bool allowDowngrade() const;
267 
269  void setAllowNameChange( bool yesno_r );
270  void setDefaultAllowNameChange(); // Set back to default
271  bool allowNameChange() const;
272 
274  void setAllowArchChange( bool yesno_r );
275  void setDefaultAllowArchChange(); // Set back to default
276  bool allowArchChange() const;
277 
281  void setAllowVendorChange( bool yesno_r );
282  void setDefaultAllowVendorChange(); // Set back to default
283  bool allowVendorChange() const;
285 
291  void setSystemVerification( bool yesno_r );
292  void setDefaultSystemVerification();
293  bool systemVerification() const;
294 
304  void setSolveSrcPackages( bool yesno_r );
305  void setDefaultSolveSrcPackages();
306  bool solveSrcPackages() const;
307 
312  void setCleandepsOnRemove( bool yesno_r );
313  void setDefaultCleandepsOnRemove(); // set back to default (in zypp.conf)
314  bool cleandepsOnRemove() const;
315 
322  void dupSetAllowDowngrade( bool yesno_r );
323  void dupSetDefaultAllowDowngrade(); // Set back to default (in zypp.conf)
324  bool dupAllowDowngrade() const;
325 
327  void dupSetAllowNameChange( bool yesno_r );
328  void dupSetDefaultAllowNameChange(); // Set back to default (in zypp.conf)
329  bool dupAllowNameChange() const;
330 
332  void dupSetAllowArchChange( bool yesno_r );
333  void dupSetDefaultAllowArchChange(); // Set back to default (in zypp.conf)
334  bool dupAllowArchChange() const;
335 
337  void dupSetAllowVendorChange( bool yesno_r );
338  void dupSetDefaultAllowVendorChange(); // Set back to default (in zypp.conf)
339  bool dupAllowVendorChange() const;
341 
353  void addUpgradeRepo( Repository repo_r );
354 
358  bool upgradingRepos() const;
359 
363  bool upgradingRepo( Repository repo_r ) const;
364 
368  void removeUpgradeRepo( Repository repo_r );
369 
373  void removeUpgradeRepos();
375 
380  void addRequire( const Capability & capability );
381 
386  void addConflict( const Capability & capability );
387 
392  void removeRequire( const Capability & capability );
393 
398  void removeConflict( const Capability & capability );
399 
404  CapabilitySet getRequire() const;
405 
410  CapabilitySet getConflict() const;
411 
418  bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true );
419 
434  solver::detail::ItemCapKindList isInstalledBy( const PoolItem & item );
435 
450  solver::detail::ItemCapKindList installs( const PoolItem & item );
451 
466  solver::detail::ItemCapKindList satifiedByInstalled( const PoolItem & item );
467 
468 
483  solver::detail::ItemCapKindList installedSatisfied( const PoolItem & item );
484 
485  public:
487  sat::detail::CSolver * get() const;
488 
489  private:
490  friend std::ostream & operator<<( std::ostream & str, const Resolver & obj );
492  };
494 
496  std::ostream & operator<<( std::ostream & str, const Resolver & obj );
497 
499 } // namespace zypp
501 #endif // ZYPP_RESOLVER_H
Common types used in the Resolver public API and need to be passed down to the details tree...
::s_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
Definition: PoolMember.h:65
ResolverFocus
The resolver&#39;s general attitude.
Definition: ResolverFocus.h:23
String related utilities and Regular expression matching.
zypp::RW_pointer< solver::detail::ResolverInternal > _pimpl
Definition: Resolver.h:491
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
Definition: SerialNumber.cc:52
Libsolv transaction wrapper.
Definition: Transaction.h:51
_onlyRequires _dup_allowdowngrade dupAllowArchChange
Definition: Resolver.cc:176
_dumpPath dumpPath(const Pathname &root_r, const Pathname &sub_r)
dumpPath iomaip to dump &#39;(root_r)sub_r&#39; output,
Definition: librpmDb.h:42
Dependency resolver interface.
Definition: Resolver.h:44
std::list< ItemCapKind > ItemCapKindList
Definition: Types.h:42
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition: ResTraits.h:93
Base class for reference counted objects.
std::list< SolverQueueItem_Ptr > SolverQueueItemList
Definition: Types.h:45
std::unordered_set< Capability > CapabilitySet
Definition: Capability.h:35
_onlyRequires dupAllowDowngrade
Definition: Resolver.cc:174
Global ResObject pool.
Definition: ResPool.h:61
std::list< ResolverProblem_Ptr > ResolverProblemList
Definition: ProblemTypes.h:46
A sat capability.
Definition: Capability.h:62
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:292
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
std::list< ProblemSolution_Ptr > ProblemSolutionList
Definition: ProblemTypes.h:43