libzypp  13.10.6
zypp::Resolver Class Reference

Dependency resolver interface. More...

#include <Resolver.h>

Inheritance diagram for zypp::Resolver:
zypp::base::ReferenceCounted

Public Member Functions

 Resolver (const ResPool &pool)
 Ctor. More...
 
virtual ~Resolver ()
 Dtor. More...
 
bool verifySystem ()
 Resolve package dependencies: More...
 
bool resolvePool ()
 Resolve package dependencies: More...
 
bool resolveQueue (solver::detail::SolverQueueItemList &queue)
 Resolve package dependencies: More...
 
void undo ()
 
void reset ()
 
bool doUpgrade ()
 Do an distribution upgrade. More...
 
void doUpdate ()
 Update to newest package. More...
 
std::list< PoolItemproblematicUpdateItems () const
 Unmaintained packages which does not fit to the updated system (broken dependencies) will be deleted. More...
 
ResolverProblemList problems ()
 Return the dependency problems found by the last call to resolveDependencies(). More...
 
void applySolutions (const ProblemSolutionList &solutions)
 Apply problem solutions. More...
 
sat::Transaction getTransaction ()
 Return the Transaction computed by the last solver run. More...
 
void setForceResolve (bool force)
 Remove resolvables which are conflicts with others or have unfulfilled requirements. More...
 
bool forceResolve () const
 
void setIgnoreAlreadyRecommended (bool yesno_r)
 Ignore recommended packages that were already recommended by the installed packages. More...
 
bool ignoreAlreadyRecommended () const
 
void setOnlyRequires (bool yesno_r)
 Setting whether required packages are installed ONLY So recommended packages, language packages and packages which depend on hardware (modalias) will not be regarded. More...
 
void resetOnlyRequires ()
 
bool onlyRequires () const
 
void setUpgradeMode (bool yesno_r)
 Setting whether the solver should perform in 'upgrade' mode or not. More...
 
bool upgradeMode () const
 
void setAllowVendorChange (bool yesno_r)
 Setting whether the solver should allow or disallow vendor changes. More...
 
void setDefaultAllowVendorChange ()
 
bool allowVendorChange () const
 
void setSystemVerification (bool yesno_r)
 System verification mode also monitors and repairs dependencies of already installed packages. More...
 
void setDefaultSystemVerification ()
 
bool systemVerification () const
 
void setSolveSrcPackages (bool yesno_r)
 Set whether to solve source packages build dependencies per default. More...
 
void setDefaultSolveSrcPackages ()
 
bool solveSrcPackages () const
 
void setCleandepsOnRemove (bool yesno_r)
 Cleanup when deleting packages. More...
 
void setDefaultCleandepsOnRemove ()
 
bool cleandepsOnRemove () const
 
void addRequire (const Capability &capability)
 Adding additional requirement. More...
 
void addConflict (const Capability &capability)
 Adding additional conflict. More...
 
void removeRequire (const Capability &capability)
 Remove the additional requirement set by addRequire(Capability). More...
 
void removeConflict (const Capability &capability)
 Remove the additional conflict set by addConflict(Capability). More...
 
CapabilitySet getRequire () const
 Get all the additional requirements set by addRequire(Capability). More...
 
CapabilitySet getConflict () const
 Get all the additional conflicts set by addConflict(Capability). More...
 
bool createSolverTestcase (const std::string &dumpPath="/var/log/YaST2/solverTestcase", bool runSolver=true)
 Generates a solver Testcase of the current state. More...
 
solver::detail::ItemCapKindList isInstalledBy (const PoolItem &item)
 Gives information about WHO has pused an installation of an given item. More...
 
solver::detail::ItemCapKindList installs (const PoolItem &item)
 Gives information about WHICH additional items will be installed due the installation of an item. More...
 
solver::detail::ItemCapKindList satifiedByInstalled (const PoolItem &item)
 Gives information about WHICH installed items are requested by the installation of an item. More...
 
solver::detail::ItemCapKindList installedSatisfied (const PoolItem &item)
 Gives information about WHICH items require an already installed item. More...
 
Upgrade to content of a specific repository.
Note
This is an ordinary solver request. You should simply resolvePool to execute, and not doUpgrade.
void addUpgradeRepo (Repository repo_r)
 Adding request to perform a dist upgrade restricted to this repository. More...
 
bool upgradingRepo (Repository repo_r) const
 Whether there is an UpgradeRepo request pending for this repo. More...
 
void removeUpgradeRepo (Repository repo_r)
 Remove an upgrade request for this repo. More...
 
void removeUpgradeRepos ()
 Remove all upgrade repo requests. More...
 
- Public Member Functions inherited from zypp::base::ReferenceCounted
 ReferenceCounted ()
 Default ctor. More...
 
 ReferenceCounted (const ReferenceCounted &rhs)
 Copy ctor. More...
 
virtual ~ReferenceCounted ()
 Dtor. More...
 
ReferenceCountedoperator= (const ReferenceCounted &)
 Assignment. More...
 
unsigned refCount () const
 Return reference counter value. More...
 
void ref () const
 Add a reference. More...
 
void unref () const
 Release a reference. More...
 

Private Types

typedef solver::detail::Resolver Impl
 

Private Attributes

zypp::RW_pointer< Impl,
rw_pointer::Intrusive< Impl > > 
_pimpl
 

Friends

std::ostream & operator<< (std::ostream &str, const Resolver &obj)
 

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &str, const Resolver &obj)
 

Additional Inherited Members

- Static Public Member Functions inherited from zypp::base::ReferenceCounted
static void add_ref (const ReferenceCounted *ptr_r)
 Called by zypp::intrusive_ptr to add a reference. More...
 
static void release (const ReferenceCounted *ptr_r)
 Called by zypp::intrusive_ptr to add a reference. More...
 
- Protected Member Functions inherited from zypp::base::ReferenceCounted
virtual std::ostream & dumpOn (std::ostream &str) const
 Overload to realize std::ostream & operator<<. More...
 
virtual void ref_to (unsigned) const
 Trigger derived classes after refCount was increased. More...
 
virtual void unref_to (unsigned) const
 Trigger derived classes after refCount was decreased. More...
 

Detailed Description

Dependency resolver interface.

To resolve dependencies after making changes to the ResPool (using addRequire(), addConflict(), applySolutions(), or by making the changes directly on the PoolItem status objects, call the resolvePool() method.

Definition at line 47 of file Resolver.h.

Member Typedef Documentation

Definition at line 385 of file Resolver.h.

Constructor & Destructor Documentation

zypp::Resolver::Resolver ( const ResPool pool)

Ctor.

Definition at line 36 of file Resolver.cc.

zypp::Resolver::~Resolver ( )
virtual

Dtor.

Definition at line 45 of file Resolver.cc.

Member Function Documentation

bool zypp::Resolver::verifySystem ( )

Resolve package dependencies:

Enter systemVerification mode to monitor and repair dependencies of already installed packages, and solve immediately.

Call setSystemVerification to turn of this mode.

Definition at line 53 of file Resolver.cc.

bool zypp::Resolver::resolvePool ( )

Resolve package dependencies:

Try to execute all pending transactions (there may be more than one!). The solver collects all transactions (install/delete resolvables) from the pool, generates task, solving it and writes the results back to pool

Returns "true" on success (i.e., if there were no problems that need user interaction) and "false" if there were problems. In the latter case, use problems() and later applySolutions() below.

Definition at line 56 of file Resolver.cc.

bool zypp::Resolver::resolveQueue ( solver::detail::SolverQueueItemList queue)

Resolve package dependencies:

The solver works off the given queue and writes back the solution to pool.

Returns "true" on success (i.e., if there were no problems that need user interaction) and "false" if there were problems. In the latter case, use problems() and later applySolutions() below. The solution could be that the solver remove/add some entries in the task queue. So make a new call of resolveQueue after you have applied any solution AND check the parameter "queue" if there has been any changes by the solver and adapt these changes to e.g. the selectables.

Definition at line 59 of file Resolver.cc.

void zypp::Resolver::undo ( )

Definition at line 62 of file Resolver.cc.

void zypp::Resolver::reset ( )

Definition at line 143 of file Resolver.cc.

bool zypp::Resolver::doUpgrade ( )

Do an distribution upgrade.

Perform a distribution upgrade. This performs an update of all packages with a special resolver algorithm which takes care of package splits, pattern and product updates, etc. This call also turns the solver into upgradeMode, so consecutive calls to resolvePool performed in this mode too. Call setUpgradeMode to turn this mode off.

See Also
addUpgradeRepo

Definition at line 74 of file Resolver.cc.

void zypp::Resolver::doUpdate ( )

Update to newest package.

Install the newest version of your installed packages as far as possible. This means a newer package will NOT be installed if it generates dependency problems. So the user will not get an error message.

Definition at line 77 of file Resolver.cc.

std::list< PoolItem > zypp::Resolver::problematicUpdateItems ( ) const

Unmaintained packages which does not fit to the updated system (broken dependencies) will be deleted.

Return the list of deleted items. Note : This list is valid after the call doUpgrade() only.

Definition at line 122 of file Resolver.cc.

ResolverProblemList zypp::Resolver::problems ( )

Return the dependency problems found by the last call to resolveDependencies().

If there were no problems, the returned list will be empty.

Definition at line 65 of file Resolver.cc.

void zypp::Resolver::applySolutions ( const ProblemSolutionList solutions)

Apply problem solutions.

No more than one solution per problem can be applied.

Definition at line 68 of file Resolver.cc.

sat::Transaction zypp::Resolver::getTransaction ( )

Return the Transaction computed by the last solver run.

Definition at line 71 of file Resolver.cc.

void zypp::Resolver::setForceResolve ( bool  force)

Remove resolvables which are conflicts with others or have unfulfilled requirements.

This behaviour is favourited by ZMD.

Definition at line 80 of file Resolver.cc.

bool zypp::Resolver::forceResolve ( ) const

Definition at line 81 of file Resolver.cc.

void zypp::Resolver::setIgnoreAlreadyRecommended ( bool  yesno_r)

Ignore recommended packages that were already recommended by the installed packages.

Definition at line 83 of file Resolver.cc.

bool zypp::Resolver::ignoreAlreadyRecommended ( ) const

Definition at line 84 of file Resolver.cc.

void zypp::Resolver::setOnlyRequires ( bool  yesno_r)

Setting whether required packages are installed ONLY So recommended packages, language packages and packages which depend on hardware (modalias) will not be regarded.

Definition at line 86 of file Resolver.cc.

void zypp::Resolver::resetOnlyRequires ( )

Definition at line 87 of file Resolver.cc.

bool zypp::Resolver::onlyRequires ( ) const

Definition at line 88 of file Resolver.cc.

void zypp::Resolver::setUpgradeMode ( bool  yesno_r)

Setting whether the solver should perform in 'upgrade' mode or not.

See Also
doUpgrade.

Definition at line 90 of file Resolver.cc.

bool zypp::Resolver::upgradeMode ( ) const

Definition at line 91 of file Resolver.cc.

void zypp::Resolver::setAllowVendorChange ( bool  yesno_r)

Setting whether the solver should allow or disallow vendor changes.

If OFF (the default) the solver will replace packages with packages of the same (or equivalent) vendor ony.

See Also
VendorAttr for definition of vendor equivalence.

Definition at line 93 of file Resolver.cc.

void zypp::Resolver::setDefaultAllowVendorChange ( )

Definition at line 94 of file Resolver.cc.

bool zypp::Resolver::allowVendorChange ( ) const

Definition at line 95 of file Resolver.cc.

void zypp::Resolver::setSystemVerification ( bool  yesno_r)

System verification mode also monitors and repairs dependencies of already installed packages.

See Also
verifySystem

Definition at line 97 of file Resolver.cc.

void zypp::Resolver::setDefaultSystemVerification ( )

Definition at line 98 of file Resolver.cc.

bool zypp::Resolver::systemVerification ( ) const

Definition at line 99 of file Resolver.cc.

void zypp::Resolver::setSolveSrcPackages ( bool  yesno_r)

Set whether to solve source packages build dependencies per default.

Usually turned off and if, enabled per source package. This affects only source packges selected in the ResPool. No solver rule will be generated for them. Source packages requested via e.g. addRequire will always be solved. Be carefull. The older the source package is, the stranger may be the result of solving it's build dependencies.

Definition at line 101 of file Resolver.cc.

void zypp::Resolver::setDefaultSolveSrcPackages ( )

Definition at line 102 of file Resolver.cc.

bool zypp::Resolver::solveSrcPackages ( ) const

Definition at line 103 of file Resolver.cc.

void zypp::Resolver::setCleandepsOnRemove ( bool  yesno_r)

Cleanup when deleting packages.

Whether the solver should per default try to remove packages exclusively required by the ones he's asked to delete.

Definition at line 105 of file Resolver.cc.

void zypp::Resolver::setDefaultCleandepsOnRemove ( )

Definition at line 106 of file Resolver.cc.

bool zypp::Resolver::cleandepsOnRemove ( ) const

Definition at line 107 of file Resolver.cc.

void zypp::Resolver::addUpgradeRepo ( Repository  repo_r)

Adding request to perform a dist upgrade restricted to this repository.

This is what e.g. zypper dup –repo myrepo should perform.

See Also
doUpgrade

Definition at line 109 of file Resolver.cc.

bool zypp::Resolver::upgradingRepo ( Repository  repo_r) const

Whether there is an UpgradeRepo request pending for this repo.

Definition at line 110 of file Resolver.cc.

void zypp::Resolver::removeUpgradeRepo ( Repository  repo_r)

Remove an upgrade request for this repo.

Definition at line 111 of file Resolver.cc.

void zypp::Resolver::removeUpgradeRepos ( )

Remove all upgrade repo requests.

Definition at line 112 of file Resolver.cc.

void zypp::Resolver::addRequire ( const Capability capability)

Adding additional requirement.

Definition at line 114 of file Resolver.cc.

void zypp::Resolver::addConflict ( const Capability capability)

Adding additional conflict.

Definition at line 115 of file Resolver.cc.

void zypp::Resolver::removeRequire ( const Capability capability)

Remove the additional requirement set by addRequire(Capability).

Definition at line 116 of file Resolver.cc.

void zypp::Resolver::removeConflict ( const Capability capability)

Remove the additional conflict set by addConflict(Capability).

Definition at line 117 of file Resolver.cc.

CapabilitySet zypp::Resolver::getRequire ( ) const

Get all the additional requirements set by addRequire(Capability).

Definition at line 119 of file Resolver.cc.

CapabilitySet zypp::Resolver::getConflict ( ) const

Get all the additional conflicts set by addConflict(Capability).

Definition at line 120 of file Resolver.cc.

bool zypp::Resolver::createSolverTestcase ( const std::string &  dumpPath = "/var/log/YaST2/solverTestcase",
bool  runSolver = true 
)

Generates a solver Testcase of the current state.

dumpPath destination directory of the created directory

Returns
true if it was successful

Definition at line 125 of file Resolver.cc.

solver::detail::ItemCapKindList zypp::Resolver::isInstalledBy ( const PoolItem item)

Gives information about WHO has pused an installation of an given item.

Parameters
itemEvaluate additional information for this resolvable.
Returns
A list of structures which contains: item Item which has triggered the installation of the given param item. initialInstallation This item has triggered the installation Not already fullfilled requierement only. cap Capability which has triggerd this installation capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )

Note: In order to have a result start a solver run before. Not matter if it is valid or invalid.

Definition at line 131 of file Resolver.cc.

solver::detail::ItemCapKindList zypp::Resolver::installs ( const PoolItem item)

Gives information about WHICH additional items will be installed due the installation of an item.

Parameters
itemEvaluate additional information for this resolvable.
Returns
A list of structures which contains: item Item which has triggered the installation of the given param item. initialInstallation This item has triggered the installation Not already fullfilled requierement only. cap Capability which has triggerd this installation capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )

Note: In order to have a result start a solver run before. Not matter if it is valid or invalid.

Definition at line 134 of file Resolver.cc.

solver::detail::ItemCapKindList zypp::Resolver::satifiedByInstalled ( const PoolItem item)

Gives information about WHICH installed items are requested by the installation of an item.

Parameters
itemEvaluate additional information for this resolvable.
Returns
A list of structures which contains: item Item which has triggered the installation of the given param item. initialInstallation This item has triggered the installation Not already fullfilled requierement only. cap Capability which has triggerd this installation capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )

Note: In order to have a result start a solver run before. Not matter if it is valid or invalid.

Definition at line 137 of file Resolver.cc.

solver::detail::ItemCapKindList zypp::Resolver::installedSatisfied ( const PoolItem item)

Gives information about WHICH items require an already installed item.

Parameters
itemEvaluate additional information for this resolvable.
Returns
A list of structures which contains: item Item which has triggered the installation of the given param item. initialInstallation This item has triggered the installation Not already fullfilled requierement only. cap Capability which has triggerd this installation capKind Kind of that capability (e.g. Dep::REQUIRES,Dep::RECOMMENDS,... )

Note: In order to have a result start a solver run before. Not matter if it is valid or invalid.

Definition at line 140 of file Resolver.cc.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  str,
const Resolver obj 
)
friend

Definition at line 146 of file Resolver.cc.

std::ostream & operator<< ( std::ostream &  str,
const Resolver obj 
)
related

Stream output

Definition at line 146 of file Resolver.cc.

Member Data Documentation

zypp::RW_pointer<Impl,rw_pointer::Intrusive<Impl> > zypp::Resolver::_pimpl
private

Definition at line 386 of file Resolver.h.


The documentation for this class was generated from the following files: