libzypp 17.35.11
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
24namespace 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)
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.
A sat capability.
Definition Capability.h:63
Combining sat::Solvable and ResStatus.
Definition PoolItem.h:51
Global ResObject pool.
Definition ResPool.h:62
Dependency resolver interface.
Definition Resolver.h:45
void setDefaultAllowVendorChange()
void setAllowNameChange(bool yesno_r)
Whether to allow one to change name of installed solvable.
void dupSetAllowNameChange(bool yesno_r)
dup mode: allow one to change name of installed solvable
void dupSetAllowVendorChange(bool yesno_r)
dup mode: allow one to change vendor of installed solvables
bool dupAllowDowngrade() const
void setDefaultAllowArchChange()
void dupSetDefaultAllowVendorChange()
bool allowNameChange() const
void dupSetDefaultAllowNameChange()
bool allowDowngrade() const
void setDefaultAllowNameChange()
void dupSetDefaultAllowDowngrade()
void setAllowVendorChange(bool yesno_r)
Whether to allow one to change vendor of installed solvables.
bool dupAllowArchChange() const
void setAllowDowngrade(bool yesno_r)
Whether to allow one to downgrade installed solvable.
bool dupAllowNameChange() const
void dupSetDefaultAllowArchChange()
bool allowArchChange() const
bool dupAllowVendorChange() const
void setDefaultAllowDowngrade()
bool allowVendorChange() const
zypp::RW_pointer< solver::detail::ResolverInternal > _pimpl
Definition Resolver.h:491
void setAllowArchChange(bool yesno_r)
Whether to allow one to change architecture of installed solvables.
void dupSetAllowArchChange(bool yesno_r)
dup mode: allow one to change architecture of installed solvables
void dupSetAllowDowngrade(bool yesno_r)
dup mode: allow one to downgrade installed solvable
Base class for reference counted objects.
Libsolv transaction wrapper.
Definition Transaction.h:52
String related utilities and Regular expression matching.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition NonCopyable.h:26
::s_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
Definition PoolMember.h:65
std::list< SolverQueueItem_Ptr > SolverQueueItemList
Definition Types.h:45
std::list< ItemCapKind > ItemCapKindList
Definition Types.h:42
Easy-to use interface to the ZYPP dependency resolver.
std::list< ProblemSolution_Ptr > ProblemSolutionList
ResolverFocus
The resolver's general attitude.
std::list< ResolverProblem_Ptr > ResolverProblemList
std::ostream & operator<<(std::ostream &str, const SerialNumber &obj)
std::unordered_set< Capability > CapabilitySet
Definition Capability.h:35
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293