zypp::Resolver Class Reference

Resolver interface. More...

#include <Resolver.h>

Inheritance diagram for zypp::Resolver:
[legend]

List of all members.

Public Member Functions

 Resolver (const ResPool &pool)
 Ctor.
virtual ~Resolver ()
 Dtor.
bool verifySystem ()
 Resolve package dependencies:.
bool verifySystem (bool considerNewHardware)
 Resolve package dependencies:.
bool establishPool (void)
 Establish state of 'higher level' Resolvables in Pool.
bool freshenPool (void)
 go through all package 'freshen' dependencies and schedule matches for installation.
bool resolvePool (void)
 Resolve package dependencies:.
bool resolvePool (bool tryAllPossibilities)
 Resolve package dependencies:.
bool resolveDependencies (void)
void undo (void)
solver::detail::ResolverContext_Ptr context (void) const
void doUpgrade (UpgradeStatistics &opt_stats_r)
 Do an distribution upgrade.
std::list< PoolItem_RefproblematicUpdateItems (void) const
 Return the list of problematic update items i.e.
ResolverProblemList problems ()
 Return the dependency problems found by the last call to resolveDependencies().
std::list< std::string > problemDescription (void) const
 Return more solver information if an error has happened.
void applySolutions (const ProblemSolutionList &solutions)
 Apply problem solutions.
Arch architecture () const
void setArchitecture (const Arch &arch)
void setForceResolve (const bool force)
 Remove resolvables which are conflicts with others or have unfulfilled requirements.
const bool forceResolve ()
void setPreferHighestVersion (const bool highestVersion)
 Prefer the result with the newest version if there are more solver results.
const bool preferHighestVersion ()
bool transactResObject (ResObject::constPtr robj, bool install=true)
 transact a single ResObject
bool transactResKind (Resolvable::Kind kind)
 transact all objects of this kind
void transactReset (ResStatus::TransactByValue causer)
 reset any transact states
void addRequire (const Capability &capability)
 Adding additional requirement.
void addConflict (const Capability &capability)
 Adding additional conflict.
void setTimeout (int seconds)
 Setting solver timeout.
int timeout ()
 Getting solver timeout in seconds.
void setMaxSolverPasses (int count)
 Restricting solver passes.
int maxSolverPasses ()
 Count of max solver passes.
bool createSolverTestcase (const std::string &dumpPath="/var/log/YaST2/solverTestcase")
 Generates a solver Testcase of the current state.
const
solver::detail::ItemCapKindList 
isInstalledBy (const PoolItem_Ref item)
 Gives information about WHO has pused an installation of an given item.
const
solver::detail::ItemCapKindList 
installs (const PoolItem_Ref item)
 Gives information about WHICH additional items will be installed due the installation of an item.

Private Attributes

solver::detail::Resolver_Ptr _pimpl


Detailed Description

Resolver interface.

Definition at line 39 of file Resolver.h.


Constructor & Destructor Documentation

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

Ctor.

Definition at line 41 of file Resolver.cc.

References _pimpl.

zypp::solver::detail::Resolver::~Resolver (  )  [virtual]

Dtor.

Definition at line 51 of file Resolver.cc.


Member Function Documentation

bool zypp::Resolver::verifySystem (  ) 

Resolve package dependencies:.

Verify consistency of system

Definition at line 59 of file Resolver.cc.

References _pimpl.

bool zypp::solver::detail::Resolver::verifySystem ( bool  considerNewHardware  ) 

Resolve package dependencies:.

Verify consistency of system considerNewHardware = install packages which depends on new hardware

Definition at line 61 of file Resolver.cc.

References _pimpl.

bool zypp::solver::detail::Resolver::establishPool ( void   ) 

Establish state of 'higher level' Resolvables in Pool.

Must be called when dealing with non-package resolvables, like Patches, Patterns, and Products

Must be called with a 'plain' pool, e.g. no additonal transacts set.

return true if it was successful return false if not (this will only happen if other transactions are in the pool which will lead to no solution)

Definition at line 63 of file Resolver.cc.

References _pimpl.

bool zypp::Resolver::freshenPool ( void   ) 

go through all package 'freshen' dependencies and schedule matches for installation.

To be called at begin of installation and upgrade. Probably also useful after adding a new package repository.

return true if it was successful return false if not (this will only happen if other transactions are in the pool which will lead to no solution)

Definition at line 65 of file Resolver.cc.

References _pimpl.

bool zypp::Resolver::resolvePool ( void   ) 

Resolve package dependencies:.

Try to execute all pending transactions (there may be more than one!). The solver pays attention to the BEST packages only in order to come to a solution. If there has not been found a valid results all other branches (e.G. packages with older version numbers, worse architecture) will be regarded.

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 67 of file Resolver.cc.

References _pimpl.

Referenced by zypp::solver::detail::Testcase::createTestcase().

bool zypp::solver::detail::Resolver::resolvePool ( bool  tryAllPossibilities  ) 

Resolve package dependencies:.

Try to execute all pending transactions (there may be more than one!). If tryAllPossibilities is false, restrict searches for matching requirements to best architecture, highest version. If tryAllPossibilities is true, evaluate all possible matches for a requirement.

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 69 of file Resolver.cc.

References _pimpl.

bool zypp::Resolver::resolveDependencies ( void   ) 

Definition at line 71 of file Resolver.cc.

References _pimpl.

void zypp::solver::detail::Resolver::undo ( void   ) 

Definition at line 73 of file Resolver.cc.

References _pimpl.

ResolverContext_Ptr zypp::solver::detail::Resolver::context ( void   )  const

Definition at line 75 of file Resolver.cc.

References _pimpl.

void zypp::solver::detail::Resolver::doUpgrade ( UpgradeStatistics opt_stats_r  ) 

Do an distribution upgrade.

This will run a full upgrade on the pool, taking all upgrade dependencies (provide/obsolete for package renames, split- provides, etc.) into account and actually removing installed packages if no upgrade exists.

To be run with great caution. It basically brings your system 'back to start'. Quite helpful to get back to a 'sane state'. Quite disastrous since you'll loose all non-distribution packages

Definition at line 83 of file Resolver.cc.

References _pimpl.

std::list< PoolItem_Ref > zypp::Resolver::problematicUpdateItems ( void   )  const

Return the list of problematic update items i.e.

locked ones (due to foreign vendor)

Definition at line 107 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 77 of file Resolver.cc.

References _pimpl.

std::list< std::string > zypp::solver::detail::Resolver::problemDescription ( void   )  const

Return more solver information if an error has happened.

Definition at line 79 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 81 of file Resolver.cc.

References _pimpl.

Arch zypp::Resolver::architecture (  )  const

Definition at line 85 of file Resolver.cc.

References _pimpl.

Referenced by zypp::solver::detail::Testcase::createTestcase().

void zypp::Resolver::setArchitecture ( const Arch arch  ) 

Definition at line 87 of file Resolver.cc.

References _pimpl.

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

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

This behaviour is favourited by ZMD.

Definition at line 89 of file Resolver.cc.

References _pimpl.

const bool zypp::Resolver::forceResolve (  ) 

Definition at line 91 of file Resolver.cc.

References _pimpl.

void zypp::Resolver::setPreferHighestVersion ( const bool  highestVersion  ) 

Prefer the result with the newest version if there are more solver results.

Definition at line 93 of file Resolver.cc.

References _pimpl.

const bool zypp::Resolver::preferHighestVersion (  ) 

Definition at line 95 of file Resolver.cc.

References _pimpl.

bool zypp::Resolver::transactResObject ( ResObject::constPtr  robj,
bool  install = true 
)

transact a single ResObject

Installs (install == true) or removes (install == false) all required and recommended packages(!) of robj (More or less a 'single step' resolver call)

returns false if requirements are not all fulfillable

Definition at line 97 of file Resolver.cc.

References _pimpl.

bool zypp::solver::detail::Resolver::transactResKind ( Resolvable::Kind  kind  ) 

transact all objects of this kind

Look through the pool and runs transactResObject, first for removes then for installs (More or less a 'single step' resolver call)

returns false if any transactResObject() call returned false.

Definition at line 99 of file Resolver.cc.

References _pimpl.

void zypp::solver::detail::Resolver::transactReset ( ResStatus::TransactByValue  causer  ) 

reset any transact states

Look through the pool and clear transact state. It will only reset states which have an equal or lower causer

Definition at line 101 of file Resolver.cc.

References _pimpl.

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

Adding additional requirement.

Definition at line 103 of file Resolver.cc.

References _pimpl.

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

Adding additional conflict.

Definition at line 105 of file Resolver.cc.

References _pimpl.

void zypp::Resolver::setTimeout ( int  seconds  ) 

Setting solver timeout.

Stop solving after a given timeframe (seconds) seconds = 0 : No timeout

Definition at line 109 of file Resolver.cc.

References _pimpl.

Referenced by zypp::solver::detail::TransactionSolutionAction::execute().

int zypp::Resolver::timeout (  ) 

Getting solver timeout in seconds.

Definition at line 113 of file Resolver.cc.

References _pimpl.

Referenced by zypp::solver::detail::TransactionSolutionAction::execute().

void zypp::Resolver::setMaxSolverPasses ( int  count  ) 

Restricting solver passes.

Stop solving after a given amount of passes count = 0 : No restriction

Definition at line 111 of file Resolver.cc.

References _pimpl.

int zypp::Resolver::maxSolverPasses (  ) 

Count of max solver passes.

Definition at line 115 of file Resolver.cc.

References _pimpl.

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

Generates a solver Testcase of the current state.

dumpPath destination directory of the created directory

Returns:
true if it was successful

Definition at line 117 of file Resolver.cc.

References _pimpl, and zypp::solver::detail::Testcase::createTestcase().

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

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

Parameters:
item Evaluate additional information for this resolvable.
Returns:
A list of structures which contains: item Item which has triggered the installation of the given param item. 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 120 of file Resolver.cc.

References _pimpl.

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

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

Parameters:
item Evaluate additional information for this resolvable.
Returns:
A list of structures which contains: item Item which will be installed due to the installation of the given param item too. cap Capability which causes the 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 122 of file Resolver.cc.

References _pimpl.


Member Data Documentation

solver::detail::Resolver_Ptr zypp::Resolver::_pimpl [private]

Definition at line 324 of file Resolver.h.

Referenced by addConflict(), addRequire(), applySolutions(), architecture(), context(), createSolverTestcase(), doUpgrade(), establishPool(), forceResolve(), freshenPool(), installs(), isInstalledBy(), maxSolverPasses(), preferHighestVersion(), problematicUpdateItems(), problemDescription(), problems(), resolveDependencies(), resolvePool(), Resolver(), setArchitecture(), setForceResolve(), setMaxSolverPasses(), setPreferHighestVersion(), setTimeout(), timeout(), transactReset(), transactResKind(), transactResObject(), undo(), and verifySystem().


The documentation for this class was generated from the following files:
Generated on Tue Sep 25 19:23:16 2007 for libzypp by  doxygen 1.5.3