libzypp 9.41.1
|
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 upgradingRepos() const; 00260 00264 bool upgradingRepo( Repository repo_r ) const; 00265 00269 void removeUpgradeRepo( Repository repo_r ); 00270 00274 void removeUpgradeRepos(); 00276 00281 void addRequire( const Capability & capability ); 00282 00287 void addConflict( const Capability & capability ); 00288 00293 void removeRequire( const Capability & capability ); 00294 00299 void removeConflict( const Capability & capability ); 00300 00305 CapabilitySet getRequire() const; 00306 00311 CapabilitySet getConflict() const; 00312 00319 bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true ); 00320 00335 solver::detail::ItemCapKindList isInstalledBy( const PoolItem & item ); 00336 00351 solver::detail::ItemCapKindList installs( const PoolItem & item ); 00352 00367 solver::detail::ItemCapKindList satifiedByInstalled( const PoolItem & item ); 00368 00369 00384 solver::detail::ItemCapKindList installedSatisfied( const PoolItem & item ); 00385 00386 00387 private: 00388 friend std::ostream & operator<<( std::ostream & str, const Resolver & obj ); 00389 00390 typedef solver::detail::Resolver Impl; 00391 zypp::RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl; 00392 }; 00394 00396 std::ostream & operator<<( std::ostream & str, const Resolver & obj ); 00397 00399 } // namespace zypp 00401 #endif // ZYPP_RESOLVER_H