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(); 00168 00173 void setIgnoreAlreadyRecommended( bool yesno_r ); 00174 bool ignoreAlreadyRecommended(); 00175 00181 void setOnlyRequires( bool yesno_r ); 00182 void resetOnlyRequires(); // set back to default (described in zypp.conf) 00183 bool onlyRequires(); 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 00238 void addUpgradeRepo( Repository repo_r ); 00239 00243 bool upgradingRepo( Repository repo_r ) const; 00244 00248 void removeUpgradeRepo( Repository repo_r ); 00249 00253 void removeUpgradeRepos(); 00255 00260 void addRequire( const Capability & capability ); 00261 00266 void addConflict( const Capability & capability ); 00267 00272 void removeRequire( const Capability & capability ); 00273 00278 void removeConflict( const Capability & capability ); 00279 00284 CapabilitySet getRequire(); 00285 00290 CapabilitySet getConflict(); 00291 00298 bool createSolverTestcase( const std::string & dumpPath = "/var/log/YaST2/solverTestcase", bool runSolver = true ); 00299 00314 solver::detail::ItemCapKindList isInstalledBy( const PoolItem & item ); 00315 00330 solver::detail::ItemCapKindList installs( const PoolItem & item ); 00331 00346 solver::detail::ItemCapKindList satifiedByInstalled( const PoolItem & item ); 00347 00348 00363 solver::detail::ItemCapKindList installedSatisfied( const PoolItem & item ); 00364 00365 00366 00367 private: 00368 solver::detail::Resolver_Ptr _pimpl; 00369 }; 00371 00373 } // namespace zypp 00375 #endif // ZYPP_RESOLVER_H