1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Resolver.h
12 #ifndef ZYPP_RESOLVER_H
13 #define ZYPP_RESOLVER_H
18 #include "zypp/base/ReferenceCounted.h"
19 #include "zypp/base/PtrTypes.h"
21 #include "zypp/ResPool.h"
22 #include "zypp/UpgradeStatistics.h"
23 #include "zypp/solver/detail/Resolver.h"
24 #include "zypp/ProblemTypes.h"
26 ///////////////////////////////////////////////////////////////////
28 { /////////////////////////////////////////////////////////////////
32 ///////////////////////////////////////////////////////////////////
34 // CLASS NAME : Resolver
36 /** Resolver interface.
38 class Resolver : public base::ReferenceCounted, private base::NonCopyable
43 Resolver( const ResPool & pool );
48 * Resolve package dependencies:
50 * Verify consistency of system
57 * Resolve package dependencies:
59 * Try to execute all pending transactions (there may be more than
61 * The solver pays attention to the BEST packages only in order to
63 * If there has not been found a valid results all other branches
64 * (e.G. packages with older version numbers, worse architecture)
67 * Returns "true" on success (i.e., if there were no problems that
68 * need user interaction) and "false" if there were problems. In
69 * the latter case, use problems() and later applySolutions()
72 bool resolvePool (void);
75 * Undo solver changes done in resolvePool()
76 * Throwing away all ignored dependencies.
81 * Do an distribution upgrade
83 * This will run a full upgrade on the pool, taking all upgrade
84 * dependencies (provide/obsolete for package renames, split-
85 * provides, etc.) into account and actually removing installed
86 * packages if no upgrade exists.
88 * To be run with great caution. It basically brings your
89 * system 'back to start'.
90 * Quite helpful to get back to a 'sane state'. Quite disastrous
91 * since you'll loose all non-distribution packages
93 void doUpgrade( UpgradeStatistics & opt_stats_r );
96 * Return the list of problematic update items
97 * i.e. locked ones (due to foreign vendor)
99 std::list<PoolItem_Ref> problematicUpdateItems( void ) const;
102 * Return the dependency problems found by the last call to
103 * resolveDependencies(). If there were no problems, the returned
104 * list will be empty.
106 ResolverProblemList problems();
110 * Apply problem solutions. No more than one solution per problem
113 void applySolutions( const ProblemSolutionList & solutions );
117 * Remove resolvables which are conflicts with others or
118 * have unfulfilled requirements.
119 * This behaviour is favourited by ZMD.
121 void setForceResolve (const bool force);
125 * Adding additional requirement
128 void addRequire (const Capability & capability);
131 * Adding additional conflict
134 void addConflict (const Capability & capability);
137 * Remove the additional requirement set by \ref addRequire(Capability).
140 void removeRequire (const Capability & capability);
143 * Remove the additional conflict set by \ref addConflict(Capability).
146 void removeConflict (const Capability & capability);
149 * Get all the additional requirements set by \ref addRequire(Capability).
152 const CapabilitySet getRequire ();
155 * Get all the additional conflicts set by \ref addConflict(Capability).
158 const CapabilitySet getConflict();
161 * Generates a solver Testcase of the current state
163 * \parame dumpPath destination directory of the created directory
164 * \return true if it was successful
166 bool createSolverTestcase (const std::string & dumpPath = "/var/log/YaST2/solverTestcase");
172 solver::detail::Resolver_Ptr _pimpl;
174 ///////////////////////////////////////////////////////////////////
176 /////////////////////////////////////////////////////////////////
178 ///////////////////////////////////////////////////////////////////
179 #endif // ZYPP_RESOLVER_H