libzypp
10.5.0
|
00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_RESOLVER_H 00013 #define ZYPP_RESOLVER_H 00014 00015 #include <iosfwd> 00016 #include <functional> 00017 00018 #include "zypp/base/ReferenceCounted.h" 00019 #include "zypp/base/PtrTypes.h" 00020 00021 #include "zypp/ResPool.h" 00022 #include "zypp/solver/detail/Resolver.h" 00023 #include "zypp/solver/detail/SolverQueueItem.h" 00024 #include "zypp/ProblemTypes.h" 00025 00027 namespace zypp 00028 { 00029 00030 namespace sat 00031 { 00032 class Transaction; 00033 } 00034 00036 // 00037 // CLASS NAME : Resolver 00038 // 00047 class Resolver : public base::ReferenceCounted, private base::NonCopyable 00048 { 00049 public: 00050 00052 Resolver( const ResPool & pool ); 00054 virtual ~Resolver(); 00055 00064 bool verifySystem(); 00065 00066 00081 bool resolvePool(); 00082 00083 00101 bool resolveQueue( solver::detail::SolverQueueItemList & queue ); 00102 00103 /* 00104 * Undo solver changes done in resolvePool() 00105 * Throwing away all ignored dependencies. 00106 */ 00107 void undo(); 00108 00109 /* 00110 * Resets solver information and verify option. 00111 */ 00112 void reset(); 00113 00114 00128 bool doUpgrade(); 00129 00139 void doUpdate( ); 00140 00148 std::list<PoolItem> problematicUpdateItems() const; 00149 00155 ResolverProblemList problems(); 00156 00157 00162 void applySolutions( const ProblemSolutionList & solutions ); 00163 00167 sat::Transaction getTransaction(); 00168 00174 void setForceResolve( bool force ); 00175 bool forceResolve() const; 00176 00181 void setIgnoreAlreadyRecommended( bool yesno_r ); 00182 bool ignoreAlreadyRecommended() const; 00183 00189 void setOnlyRequires( bool yesno_r ); 00190 void resetOnlyRequires(); // set back to default (described in zypp.conf) 00191 bool onlyRequires() const; 00192 00198 void setUpgradeMode( bool yesno_r ); 00199 bool upgradeMode() const; 00200 00209 void setAllowVendorChange( bool yesno_r ); 00210 void setDefaultAllowVendorChange(); // set back to default (in zypp.conf) 00211 bool allowVendorChange() const; 00212 00218 void setSystemVerification( bool yesno_r ); 00219 void setDefaultSystemVerification(); 00220 bool systemVerification() const; 00221 00231 void setSolveSrcPackages( bool yesno_r ); 00232 void setDefaultSolveSrcPackages(); 00233 bool solveSrcPackages() const; 00234 00239 void setCleandepsOnRemove( bool yesno_r ); 00240 void setDefaultCleandepsOnRemove(); // set back to default (in zypp.conf) 00241 bool cleandepsOnRemove() const; 00242 00254 void addUpgradeRepo( Repository repo_r ); 00255 00259 bool upgradingRepo( Repository repo_r ) const; 00260 00264 void removeUpgradeRepo( Repository repo_r ); 00265 00269 void removeUpgradeRepos(); 00271 00276 void addRequire( const Capability & capability ); 00277 00282 void addConflict( const Capability & capability ); 00283 00288 void removeRequire( const Capability & capability ); 00289 00294 void removeConflict( const Capability & capability ); 00295 00300 CapabilitySet getRequire() const; 00301 00306 CapabilitySet getConflict() const; 00307 00314 bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true ); 00315 00330 solver::detail::ItemCapKindList isInstalledBy( const PoolItem & item ); 00331 00346 solver::detail::ItemCapKindList installs( const PoolItem & item ); 00347 00362 solver::detail::ItemCapKindList satifiedByInstalled( const PoolItem & item ); 00363 00364 00379 solver::detail::ItemCapKindList installedSatisfied( const PoolItem & item ); 00380 00381 00382 private: 00383 friend std::ostream & operator<<( std::ostream & str, const Resolver & obj ); 00384 00385 typedef solver::detail::Resolver Impl; 00386 zypp::RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl; 00387 }; 00389 00391 std::ostream & operator<<( std::ostream & str, const Resolver & obj ); 00392 00394 } // namespace zypp 00396 #endif // ZYPP_RESOLVER_H