libzypp 8.13.6
|
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 00032 // 00033 // CLASS NAME : Resolver 00034 // 00043 class Resolver : public base::ReferenceCounted, private base::NonCopyable 00044 { 00045 public: 00046 00048 Resolver( const ResPool & pool ); 00050 virtual ~Resolver(); 00051 00060 bool verifySystem(); 00061 00062 00077 bool resolvePool(); 00078 00079 00097 bool resolveQueue( solver::detail::SolverQueueItemList & queue ); 00098 00099 /* 00100 * Undo solver changes done in resolvePool() 00101 * Throwing away all ignored dependencies. 00102 */ 00103 void undo(); 00104 00105 /* 00106 * Resets solver information and verify option. 00107 */ 00108 void reset(); 00109 00110 00124 bool doUpgrade(); 00125 00135 void doUpdate( ); 00136 00144 std::list<PoolItem> problematicUpdateItems() const; 00145 00151 ResolverProblemList problems(); 00152 00153 00158 void applySolutions( const ProblemSolutionList & solutions ); 00159 00160 00166 void setForceResolve( bool force ); 00167 bool forceResolve() const; 00168 00173 void setIgnoreAlreadyRecommended( bool yesno_r ); 00174 bool ignoreAlreadyRecommended() const; 00175 00181 void setOnlyRequires( bool yesno_r ); 00182 void resetOnlyRequires(); // set back to default (described in zypp.conf) 00183 bool onlyRequires() const; 00184 00190 void setUpgradeMode( bool yesno_r ); 00191 bool upgradeMode() const; 00192 00201 void setAllowVendorChange( bool yesno_r ); 00202 void setDefaultAllowVendorChange(); // set back to default (in zypp.conf) 00203 bool allowVendorChange() const; 00204 00210 void setSystemVerification( bool yesno_r ); 00211 void setDefaultSystemVerification(); 00212 bool systemVerification() const; 00213 00223 void setSolveSrcPackages( bool yesno_r ); 00224 void setDefaultSolveSrcPackages(); 00225 bool solveSrcPackages() const; 00226 00231 void setCleandepsOnRemove( bool yesno_r ); 00232 void setDefaultCleandepsOnRemove(); // set back to default (in zypp.conf) 00233 bool cleandepsOnRemove() const; 00234 00246 void addUpgradeRepo( Repository repo_r ); 00247 00251 bool upgradingRepo( Repository repo_r ) const; 00252 00256 void removeUpgradeRepo( Repository repo_r ); 00257 00261 void removeUpgradeRepos(); 00263 00268 void addRequire( const Capability & capability ); 00269 00274 void addConflict( const Capability & capability ); 00275 00280 void removeRequire( const Capability & capability ); 00281 00286 void removeConflict( const Capability & capability ); 00287 00292 CapabilitySet getRequire() const; 00293 00298 CapabilitySet getConflict() const; 00299 00306 bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true ); 00307 00322 solver::detail::ItemCapKindList isInstalledBy( const PoolItem & item ); 00323 00338 solver::detail::ItemCapKindList installs( const PoolItem & item ); 00339 00354 solver::detail::ItemCapKindList satifiedByInstalled( const PoolItem & item ); 00355 00356 00371 solver::detail::ItemCapKindList installedSatisfied( const PoolItem & item ); 00372 00373 00374 private: 00375 friend std::ostream & operator<<( std::ostream & str, const Resolver & obj ); 00376 00377 typedef solver::detail::Resolver Impl; 00378 zypp::RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl; 00379 }; 00381 00383 std::ostream & operator<<( std::ostream & str, const Resolver & obj ); 00384 00386 } // namespace zypp 00388 #endif // ZYPP_RESOLVER_H