libzypp  11.13.5
Resolver.cc
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
12 #include <iostream>
13 
14 #include "zypp/Resolver.h"
15 #include "zypp/ZConfig.h"
16 #include "zypp/TriBool.h"
19 #include "zypp/sat/Transaction.h"
20 
21 using namespace std;
22 
24 namespace zypp
25 {
26 
27  using namespace solver;
28 
29  IMPL_PTR_TYPE(Resolver);
30 
32  //
33  // METHOD NAME : Resolver::Resolver
34  // METHOD TYPE : Ctor
35  //
36  Resolver::Resolver( const ResPool & pool )
37  : _pimpl( new Impl(pool) )
38  {}
39 
41  //
42  // METHOD NAME : Resolver::~Resolver
43  // METHOD TYPE : Dtor
44  //
46  {}
47 
49  //
50  // Resolver interface forwarded to implementation
51  //
54  { return _pimpl->verifySystem(); }
55 
57  { return _pimpl->resolvePool(); }
58 
60  { return _pimpl->resolveQueue(queue); }
61 
63  { _pimpl->undo(); }
64 
66  { return _pimpl->problems (); }
67 
69  { _pimpl->applySolutions (solutions); }
70 
72  { return _pimpl->getTransaction(); }
73 
75  { return _pimpl->doUpgrade(); }
76 
78  { _pimpl->doUpdate(); }
79 
80  void Resolver::setForceResolve( bool yesno_r ) { _pimpl->setForceResolve( yesno_r ); }
81  bool Resolver::forceResolve() const { return _pimpl->forceResolve(); }
82 
85 
86  void Resolver::setOnlyRequires( bool yesno_r ) { _pimpl->setOnlyRequires( yesno_r ); }
87  void Resolver::resetOnlyRequires() { _pimpl->setOnlyRequires( indeterminate ); }
88  bool Resolver::onlyRequires() const { return _pimpl->onlyRequires(); }
89 
90  void Resolver::setUpgradeMode( bool yesno_r ) { return _pimpl->setUpgradeMode( yesno_r ); }
91  bool Resolver::upgradeMode() const { return _pimpl->isUpgradeMode(); }
92 
93  void Resolver::setAllowVendorChange( bool yesno_r ) { _pimpl->setAllowVendorChange( yesno_r ); }
96 
97  void Resolver::setSystemVerification( bool yesno_r ) { _pimpl->setVerifyingMode( yesno_r ); }
98  void Resolver::setDefaultSystemVerification() { _pimpl->setVerifyingMode( indeterminate ); }
99  bool Resolver::systemVerification() const { return _pimpl->isVerifyingMode(); }
100 
101  void Resolver::setSolveSrcPackages( bool yesno_r ) { _pimpl->setSolveSrcPackages( yesno_r ); }
104 
105  void Resolver::setCleandepsOnRemove( bool yesno_r ) { _pimpl->setCleandepsOnRemove( yesno_r ); }
108 
110  bool Resolver::upgradingRepo( Repository repo_r ) const { return _pimpl->upgradingRepo( repo_r ); }
113 
114  void Resolver::addRequire( const Capability & capability ) { _pimpl->addExtraRequire( capability ); }
115  void Resolver::addConflict( const Capability & capability ) { _pimpl->addExtraConflict( capability ); }
116  void Resolver::removeRequire( const Capability & capability ) { _pimpl->removeExtraRequire( capability ); }
117  void Resolver::removeConflict( const Capability & capability ){ _pimpl->removeExtraConflict( capability ); }
118 
119  CapabilitySet Resolver::getRequire() const { return _pimpl->extraRequires(); }
120  CapabilitySet Resolver::getConflict() const { return _pimpl->extraConflicts(); }
121 
122  std::list<PoolItem> Resolver::problematicUpdateItems() const
123  { return _pimpl->problematicUpdateItems(); }
124 
125  bool Resolver::createSolverTestcase( const std::string & dumpPath, bool runSolver )
126  {
127  solver::detail::Testcase testcase (dumpPath);
128  return testcase.createTestcase(*_pimpl, true, runSolver);
129  }
130 
132  { return _pimpl->isInstalledBy (item); }
133 
135  { return _pimpl->installs (item); }
136 
138  { return _pimpl->satifiedByInstalled (item); }
139 
141  { return _pimpl->installedSatisfied (item); }
142 
144  { _pimpl->reset( false ); /* Do not keep extra requires/conflicts */ }
145 
146  std::ostream & operator<<( std::ostream & str, const Resolver & obj )
147  { return str << *obj._pimpl; }
148 
150 } // namespace zypp