#include <Resolver.h>
Public Member Functions | |
Resolver (const ResPool &pool) | |
Ctor. | |
virtual | ~Resolver () |
Dtor. | |
bool | verifySystem () |
Resolve package dependencies:. | |
bool | resolvePool () |
Resolve package dependencies:. | |
bool | resolveQueue (solver::detail::SolverQueueItemList &queue) |
Resolve package dependencies:. | |
void | undo () |
void | reset () |
bool | doUpgrade () |
Do an distribution upgrade. | |
void | doUpdate () |
Update to newest package. | |
std::list< PoolItem > | problematicUpdateItems () const |
Unmaintained packages which does not fit to the updated system (broken dependencies) will be deleted. | |
ResolverProblemList | problems () |
Return the dependency problems found by the last call to resolveDependencies(). | |
void | applySolutions (const ProblemSolutionList &solutions) |
Apply problem solutions. | |
void | setForceResolve (bool force) |
Remove resolvables which are conflicts with others or have unfulfilled requirements. | |
bool | forceResolve () |
void | setIgnoreAlreadyRecommended (bool yesno_r) |
Ignore recommended packages that were already recommended by the installed packages. | |
bool | ignoreAlreadyRecommended () |
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. | |
void | resetOnlyRequires () |
bool | onlyRequires () |
void | setUpgradeMode (bool yesno_r) |
Setting whether the solver should perform in 'upgrade' mode or not. | |
bool | upgradeMode () const |
void | setAllowVendorChange (bool yesno_r) |
Setting whether the solver should allow or disallow vendor changes. | |
void | setDefaultAllowVendorChange () |
bool | allowVendorChange () const |
void | setSystemVerification (bool yesno_r) |
System verification mode also monitors and repairs dependencies of already installed packages. | |
void | setDefaultSystemVerification () |
bool | systemVerification () const |
void | setSolveSrcPackages (bool yesno_r) |
Set whether to solve source packages build dependencies per default. | |
void | setDefaultSolveSrcPackages () |
bool | solveSrcPackages () const |
void | addRequire (const Capability &capability) |
Adding additional requirement. | |
void | addConflict (const Capability &capability) |
Adding additional conflict. | |
void | removeRequire (const Capability &capability) |
Remove the additional requirement set by addRequire(Capability). | |
void | removeConflict (const Capability &capability) |
Remove the additional conflict set by addConflict(Capability). | |
CapabilitySet | getRequire () |
Get all the additional requirements set by addRequire(Capability). | |
CapabilitySet | getConflict () |
Get all the additional conflicts set by addConflict(Capability). | |
bool | createSolverTestcase (const std::string &dumpPath="/var/log/YaST2/solverTestcase", bool runSolver=true) |
Generates a solver Testcase of the current state. | |
solver::detail::ItemCapKindList | isInstalledBy (const PoolItem &item) |
Gives information about WHO has pused an installation of an given item. | |
solver::detail::ItemCapKindList | installs (const PoolItem &item) |
Gives information about WHICH additional items will be installed due the installation of an item. | |
solver::detail::ItemCapKindList | satifiedByInstalled (const PoolItem &item) |
Gives information about WHICH installed items are requested by the installation of an item. | |
solver::detail::ItemCapKindList | installedSatisfied (const PoolItem &item) |
Gives information about WHICH items require an already installed item. | |
Upgrade to content of a specific repository. | |
| |
void | addUpgradeRepo (Repository repo_r) |
Adding request to perform a dist upgrade restricted to this repository. | |
bool | upgradingRepo (Repository repo_r) const |
Whether there is an UpgradeRepo request pending for this repo. | |
void | removeUpgradeRepo (Repository repo_r) |
Remove an upgrade request for this repo. | |
void | removeUpgradeRepos () |
Remove all upgrade repo requests. | |
Private Attributes | |
solver::detail::Resolver_Ptr | _pimpl |
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 43 of file Resolver.h.
zypp::solver::detail::Resolver::Resolver | ( | const ResPool & | pool | ) |
zypp::solver::detail::Resolver::~Resolver | ( | ) | [virtual] |
bool zypp::solver::detail::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.
References _pimpl.
bool zypp::solver::detail::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.
References _pimpl.
Referenced by zypp::solver::detail::Testcase::createTestcase().
bool zypp::solver::detail::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.
References _pimpl.
void zypp::solver::detail::Resolver::undo | ( | ) |
void zypp::Resolver::reset | ( | ) |
bool zypp::solver::detail::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.
Definition at line 71 of file Resolver.cc.
References _pimpl.
void zypp::solver::detail::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 74 of file Resolver.cc.
References _pimpl.
PoolItemList zypp::solver::detail::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 115 of file Resolver.cc.
References _pimpl.
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.
References _pimpl.
void zypp::solver::detail::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.
References _pimpl.
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 77 of file Resolver.cc.
References _pimpl.
bool zypp::Resolver::forceResolve | ( | ) |
Definition at line 78 of file Resolver.cc.
References _pimpl.
Referenced by zypp::solver::detail::Testcase::createTestcase().
void zypp::Resolver::setIgnoreAlreadyRecommended | ( | bool | yesno_r | ) |
Ignore recommended packages that were already recommended by the installed packages.
Definition at line 80 of file Resolver.cc.
References _pimpl.
bool zypp::Resolver::ignoreAlreadyRecommended | ( | ) |
Definition at line 81 of file Resolver.cc.
References _pimpl.
Referenced by zypp::solver::detail::Testcase::createTestcase().
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 83 of file Resolver.cc.
References _pimpl.
void zypp::Resolver::resetOnlyRequires | ( | ) |
bool zypp::Resolver::onlyRequires | ( | ) |
Definition at line 85 of file Resolver.cc.
References _pimpl.
Referenced by zypp::solver::detail::Testcase::createTestcase().
void zypp::Resolver::setUpgradeMode | ( | bool | yesno_r | ) |
Setting whether the solver should perform in 'upgrade' mode or not.
Definition at line 87 of file Resolver.cc.
References _pimpl.
bool zypp::Resolver::upgradeMode | ( | ) | const |
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.
Definition at line 90 of file Resolver.cc.
References _pimpl.
void zypp::Resolver::setDefaultAllowVendorChange | ( | ) |
bool zypp::Resolver::allowVendorChange | ( | ) | const |
void zypp::Resolver::setSystemVerification | ( | bool | yesno_r | ) |
System verification mode also monitors and repairs dependencies of already installed packages.
Definition at line 94 of file Resolver.cc.
References _pimpl.
void zypp::Resolver::setDefaultSystemVerification | ( | ) |
bool zypp::Resolver::systemVerification | ( | ) | const |
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 98 of file Resolver.cc.
References _pimpl.
void zypp::Resolver::setDefaultSolveSrcPackages | ( | ) |
bool zypp::Resolver::solveSrcPackages | ( | ) | const |
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.
Definition at line 102 of file Resolver.cc.
References _pimpl.
bool zypp::Resolver::upgradingRepo | ( | Repository | repo_r | ) | const |
Whether there is an UpgradeRepo
request pending for this repo.
Definition at line 103 of file Resolver.cc.
References _pimpl.
void zypp::Resolver::removeUpgradeRepo | ( | Repository | repo_r | ) |
Remove an upgrade request for this repo.
Definition at line 104 of file Resolver.cc.
References _pimpl.
void zypp::Resolver::removeUpgradeRepos | ( | ) |
void zypp::Resolver::addRequire | ( | const Capability & | capability | ) |
void zypp::Resolver::addConflict | ( | const Capability & | capability | ) |
void zypp::Resolver::removeRequire | ( | const Capability & | capability | ) |
Remove the additional requirement set by addRequire(Capability).
Definition at line 109 of file Resolver.cc.
References _pimpl.
void zypp::Resolver::removeConflict | ( | const Capability & | capability | ) |
Remove the additional conflict set by addConflict(Capability).
Definition at line 110 of file Resolver.cc.
References _pimpl.
CapabilitySet zypp::Resolver::getRequire | ( | ) |
Get all the additional requirements set by addRequire(Capability).
Definition at line 112 of file Resolver.cc.
References _pimpl.
CapabilitySet zypp::Resolver::getConflict | ( | ) |
Get all the additional conflicts set by addConflict(Capability).
Definition at line 113 of file Resolver.cc.
References _pimpl.
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
Definition at line 118 of file Resolver.cc.
References _pimpl, and zypp::solver::detail::Testcase::createTestcase().
ItemCapKindList zypp::solver::detail::Resolver::isInstalledBy | ( | const PoolItem & | item | ) |
Gives information about WHO has pused an installation of an given item.
item | Evaluate additional information for this resolvable. |
Definition at line 124 of file Resolver.cc.
References _pimpl.
ItemCapKindList zypp::solver::detail::Resolver::installs | ( | const PoolItem & | item | ) |
Gives information about WHICH additional items will be installed due the installation of an item.
item | Evaluate additional information for this resolvable. |
Definition at line 127 of file Resolver.cc.
References _pimpl.
ItemCapKindList zypp::solver::detail::Resolver::satifiedByInstalled | ( | const PoolItem & | item | ) |
Gives information about WHICH installed items are requested by the installation of an item.
item | Evaluate additional information for this resolvable. |
Definition at line 130 of file Resolver.cc.
References _pimpl.
ItemCapKindList zypp::solver::detail::Resolver::installedSatisfied | ( | const PoolItem & | item | ) |
Gives information about WHICH items require an already installed item.
item | Evaluate additional information for this resolvable. |
Definition at line 133 of file Resolver.cc.
References _pimpl.
solver::detail::Resolver_Ptr zypp::Resolver::_pimpl [private] |
Definition at line 368 of file Resolver.h.
Referenced by addConflict(), addRequire(), addUpgradeRepo(), allowVendorChange(), applySolutions(), createSolverTestcase(), doUpdate(), doUpgrade(), forceResolve(), getConflict(), getRequire(), ignoreAlreadyRecommended(), installedSatisfied(), installs(), isInstalledBy(), onlyRequires(), problematicUpdateItems(), problems(), removeConflict(), removeRequire(), removeUpgradeRepo(), removeUpgradeRepos(), reset(), resetOnlyRequires(), resolvePool(), resolveQueue(), Resolver(), satifiedByInstalled(), setAllowVendorChange(), setDefaultAllowVendorChange(), setDefaultSolveSrcPackages(), setDefaultSystemVerification(), setForceResolve(), setIgnoreAlreadyRecommended(), setOnlyRequires(), setSolveSrcPackages(), setSystemVerification(), setUpgradeMode(), solveSrcPackages(), systemVerification(), undo(), upgradeMode(), upgradingRepo(), and verifySystem().