libzypp  17.23.3
Resolver.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* Resolver.cc
3  *
4  * Copyright (C) 2000-2002 Ximian, Inc.
5  * Copyright (C) 2005 SUSE Linux Products GmbH
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License,
9  * version 2, as published by the Free Software Foundation.
10  *
11  * This program is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19  * 02111-1307, USA.
20  */
21 #include <boost/static_assert.hpp>
22 
23 #define ZYPP_USE_RESOLVER_INTERNALS
24 
25 #include "zypp/base/LogTools.h"
26 #include "zypp/base/Algorithm.h"
27 
34 
35 #include "zypp/ZConfig.h"
36 #include "zypp/sat/Transaction.h"
37 
38 #define MAXSOLVERRUNS 5
39 
40 using std::endl;
41 using std::make_pair;
42 
43 #undef ZYPP_BASE_LOGGER_LOGGROUP
44 #define ZYPP_BASE_LOGGER_LOGGROUP "zypp::solver"
45 
47 namespace zypp
48 {
49  namespace solver
51  {
52  namespace detail
54  {
55 
56  //using namespace std;
57 
58 //---------------------------------------------------------------------------
59 
60 
61 std::ostream & Resolver::dumpOn( std::ostream & os ) const
62 {
63  os << "<resolver>" << endl;
64  #define OUTS(t) os << " " << #t << ":\t" << t << endl;
65  OUTS( _upgradeMode );
66  OUTS( _updateMode );
67  OUTS( _verifying );
68  OUTS( _onlyRequires );
69  OUTS( _solveSrcPackages );
70  OUTS( _cleandepsOnRemove );
71  OUTS( _ignoreAlreadyRecommended );
72  #undef OUT
73  return os << "<resolver/>";
74 }
75 
76 
77 //---------------------------------------------------------------------------
78 
79 Resolver::Resolver (const ResPool & pool)
80  : _pool(pool)
81  , _satResolver(NULL)
82  , _poolchanged(_pool.serial() )
83  , _upgradeMode (false)
84  , _updateMode (false)
85  , _verifying (false)
86  , _onlyRequires ( ZConfig::instance().solver_onlyRequires() )
87  , _solveSrcPackages ( false )
88  , _cleandepsOnRemove ( ZConfig::instance().solver_cleandepsOnRemove() )
89  , _ignoreAlreadyRecommended ( true )
90 {
91  sat::Pool satPool( sat::Pool::instance() );
92  _satResolver = new SATResolver(_pool, satPool.get());
93 }
94 
95 
97 {
98  delete _satResolver;
99 }
100 
101 //---------------------------------------------------------------------------
102 // forward flags too SATResolver
103 
104 void Resolver::setFocus( ResolverFocus focus_r ) { _satResolver->_focus = ( focus_r == ResolverFocus::Default ) ? ZConfig::instance().solver_focus() : focus_r; }
105 ResolverFocus Resolver::focus() const { return _satResolver->_focus; }
106 
107 #define ZOLV_FLAG_TRIBOOL( ZSETTER, ZGETTER, ZVARNAME, ZVARDEFAULT ) \
108  void Resolver::ZSETTER( TriBool state_r ) \
109  { _satResolver->ZVARNAME = indeterminate(state_r) ? ZVARDEFAULT : bool(state_r); } \
110  bool Resolver::ZGETTER() const \
111  { return _satResolver->ZVARNAME; } \
112 
113 // NOTE: ZVARDEFAULT must be in sync with SATResolver ctor
114 ZOLV_FLAG_TRIBOOL( setForceResolve, forceResolve, _allowuninstall, false )
115 
116 ZOLV_FLAG_TRIBOOL( setAllowDowngrade, allowDowngrade, _allowdowngrade, false )
117 ZOLV_FLAG_TRIBOOL( setAllowNameChange, allowNameChange, _allownamechange, true ) // bsc#1071466
118 ZOLV_FLAG_TRIBOOL( setAllowArchChange, allowArchChange, _allowarchchange, false )
119 ZOLV_FLAG_TRIBOOL( setAllowVendorChange, allowVendorChange, _allowvendorchange, ZConfig::instance().solver_allowVendorChange() )
120 
121 ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupAllowDowngrade, _dup_allowdowngrade, ZConfig::instance().solver_dupAllowDowngrade() )
122 ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupAllowNameChange, _dup_allownamechange, ZConfig::instance().solver_dupAllowNameChange() )
123 ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupAllowArchChange, _dup_allowarchchange, ZConfig::instance().solver_dupAllowArchChange() )
124 ZOLV_FLAG_TRIBOOL( dupSetAllowVendorChange, dupAllowVendorChange, _dup_allowvendorchange, ZConfig::instance().solver_dupAllowVendorChange() )
125 
126 #undef ZOLV_FLAG_TRIBOOL
127 //---------------------------------------------------------------------------
128 
129 void Resolver::setOnlyRequires( TriBool state_r )
130 {
131  _onlyRequires = indeterminate(state_r) ? ZConfig::instance().solver_onlyRequires() : bool(state_r);
132 }
133 
135 {
136  _cleandepsOnRemove = indeterminate(state_r) ? ZConfig::instance().solver_cleandepsOnRemove() : bool(state_r);
137 }
138 
139 //---------------------------------------------------------------------------
140 
141 ResPool Resolver::pool() const
142 { return _pool; }
143 
144 void Resolver::reset( bool keepExtras )
145 {
146  _verifying = false;
147 
148  if (!keepExtras) {
149  _extra_requires.clear();
150  _extra_conflicts.clear();
151  }
152 
153  _isInstalledBy.clear();
154  _installs.clear();
155  _satifiedByInstalled.clear();
156  _installedSatisfied.clear();
157 }
158 
159 bool Resolver::doUpgrade()
160 {
161  // Setting Resolver to upgrade mode. SAT solver will do the update
162  _upgradeMode = true;
163  return resolvePool();
164 }
165 
166 void Resolver::doUpdate()
167 {
168  _updateMode = true;
169  return _satResolver->doUpdate();
170 }
171 
172 PoolItemList Resolver::problematicUpdateItems() const
173 { return _satResolver->problematicUpdateItems(); }
174 
175 void Resolver::addExtraRequire( const Capability & capability )
176 { _extra_requires.insert (capability); }
177 
178 void Resolver::removeExtraRequire( const Capability & capability )
179 { _extra_requires.erase (capability); }
180 
181 void Resolver::addExtraConflict( const Capability & capability )
182 { _extra_conflicts.insert (capability); }
183 
184 void Resolver::removeExtraConflict( const Capability & capability )
185 { _extra_conflicts.erase (capability); }
186 
187 void Resolver::removeQueueItem( SolverQueueItem_Ptr item )
188 {
189  bool found = false;
190  for (SolverQueueItemList::const_iterator iter = _added_queue_items.begin();
191  iter != _added_queue_items.end(); iter++) {
192  if (*iter == item) {
193  _added_queue_items.remove(*iter);
194  found = true;
195  break;
196  }
197  }
198  if (!found) {
199  _removed_queue_items.push_back (item);
200  _removed_queue_items.unique ();
201  }
202 }
203 
204 void Resolver::addQueueItem( SolverQueueItem_Ptr item )
205 {
206  bool found = false;
207  for (SolverQueueItemList::const_iterator iter = _removed_queue_items.begin();
208  iter != _removed_queue_items.end(); iter++) {
209  if (*iter == item) {
210  _removed_queue_items.remove(*iter);
211  found = true;
212  break;
213  }
214  }
215  if (!found) {
216  _added_queue_items.push_back (item);
217  _added_queue_items.unique ();
218  }
219 }
220 
221 void Resolver::addWeak( const PoolItem & item )
222 { _addWeak.push_back( item ); }
223 
224 //---------------------------------------------------------------------------
225 
227 {
230  :resStatus(status)
231  { }
232 
233  bool operator()( PoolItem item ) // only transacts() items go here
234  {
235  item.status().resetTransact( resStatus );// clear any solver/establish transactions
236  return true;
237  }
238 };
239 
240 
242 {
245  :resStatus(status)
246  { }
247 
248  bool operator()( PoolItem item ) // only transacts() items go here
249  {
250  item.status().setTransact( true, resStatus );
251  return true;
252  }
253 };
254 
255 
257 {
258  UndoTransact resetting (ResStatus::APPL_HIGH);
259 
260  DBG << "Resolver::verifySystem()" << endl;
261 
262  _verifying = true;
263 
264  invokeOnEach ( _pool.begin(), _pool.end(),
265  resfilter::ByTransact( ), // Resetting all transcations
266  functor::functorRef<bool,PoolItem>(resetting) );
267 
268  return resolvePool();
269 }
270 
271 
272 //----------------------------------------------------------------------------
273 // undo
274 void Resolver::undo()
275 {
276  UndoTransact info(ResStatus::APPL_LOW);
277  MIL << "*** undo ***" << endl;
278  invokeOnEach ( _pool.begin(), _pool.end(),
279  resfilter::ByTransact( ), // collect transacts from Pool to resolver queue
280  functor::functorRef<bool,PoolItem>(info) );
281  // Regard dependencies of the item weak onl
282  _addWeak.clear();
283 
284  // Additional QueueItems which has to be regarded by the solver
285  _removed_queue_items.clear();
286  _added_queue_items.clear();
287 
288  return;
289 }
290 
291 void Resolver::solverInit()
292 {
293  // Solving with libsolv
294  static bool poolDumped = false;
295  MIL << "-------------- Calling SAT Solver -------------------" << endl;
296  if ( getenv("ZYPP_FULLLOG") ) {
297  Testcase testcase("/var/log/YaST2/autoTestcase");
298  if (!poolDumped) {
299  testcase.createTestcase (*this, true, false); // dump pool
300  poolDumped = true;
301  } else {
302  testcase.createTestcase (*this, false, false); // write control file only
303  }
304  }
305 
306  _satResolver->setFixsystem ( isVerifyingMode() );
307  _satResolver->setIgnorealreadyrecommended ( ignoreAlreadyRecommended() );
308  _satResolver->setOnlyRequires ( onlyRequires() );
309  _satResolver->setUpdatesystem (_updateMode);
310  _satResolver->setSolveSrcPackages ( solveSrcPackages() );
311  _satResolver->setCleandepsOnRemove ( cleandepsOnRemove() );
312 
313  _satResolver->setDistupgrade (_upgradeMode);
314  if (_upgradeMode) {
315  // may overwrite some settings
316  _satResolver->setDistupgrade_removeunsupported (false);
317  }
318 
319  // Resetting additional solver information
320  _isInstalledBy.clear();
321  _installs.clear();
322  _satifiedByInstalled.clear();
323  _installedSatisfied.clear();
324 }
325 
327 {
328  solverInit();
329  return _satResolver->resolvePool(_extra_requires, _extra_conflicts, _addWeak, _upgradeRepos );
330 }
331 
333 {
334  solverInit();
335 
336  // add/remove additional SolverQueueItems
337  for (SolverQueueItemList::const_iterator iter = _removed_queue_items.begin();
338  iter != _removed_queue_items.end(); iter++) {
339  for (SolverQueueItemList::const_iterator iterQueue = queue.begin(); iterQueue != queue.end(); iterQueue++) {
340  if ( (*iterQueue)->cmp(*iter) == 0) {
341  MIL << "remove from queue" << *iter;
342  queue.remove(*iterQueue);
343  break;
344  }
345  }
346  }
347 
348  for (SolverQueueItemList::const_iterator iter = _added_queue_items.begin();
349  iter != _added_queue_items.end(); iter++) {
350  bool found = false;
351  for (SolverQueueItemList::const_iterator iterQueue = queue.begin(); iterQueue != queue.end(); iterQueue++) {
352  if ( (*iterQueue)->cmp(*iter) == 0) {
353  found = true;
354  break;
355  }
356  }
357  if (!found) {
358  MIL << "add to queue" << *iter;
359  queue.push_back(*iter);
360  }
361  }
362 
363  // The application has to take care to write these solutions back to e.g. selectables in order
364  // give the user a chance for changing these decisions again.
365  _removed_queue_items.clear();
366  _added_queue_items.clear();
367 
368  return _satResolver->resolveQueue(queue, _addWeak);
369 }
370 
371 sat::Transaction Resolver::getTransaction()
372 {
373  // FIXME: That's an ugly way of pushing autoInstalled into the transaction.
374  sat::Transaction ret( sat::Transaction::loadFromPool );
375  ret.autoInstalled( _satResolver->autoInstalled() );
376  return ret;
377 }
378 
379 
380 //----------------------------------------------------------------------------
381 // Getting more information about the solve results
382 
384 {
385  MIL << "Resolver::problems()" << endl;
386  return _satResolver->problems();
387 }
388 
389 void Resolver::applySolutions( const ProblemSolutionList & solutions )
390 {
391  for ( ProblemSolution_Ptr solution : solutions )
392  {
393  if ( ! applySolution( *solution ) )
394  break;
395  }
396 }
397 
398 bool Resolver::applySolution( const ProblemSolution & solution )
399 {
400  bool ret = true;
401  DBG << "apply solution " << solution << endl;
402  for ( SolutionAction_Ptr action : solution.actions() )
403  {
404  if ( ! action->execute( *this ) )
405  {
406  WAR << "apply solution action failed: " << action << endl;
407  ret = false;
408  break;
409  }
410  }
411  return ret;
412 }
413 
414 //----------------------------------------------------------------------------
415 
416 void Resolver::collectResolverInfo()
417 {
418  if ( _satResolver
419  && _isInstalledBy.empty()
420  && _installs.empty()) {
421 
422  // generating new
423  PoolItemList itemsToInstall = _satResolver->resultItemsToInstall();
424 
425  for (PoolItemList::const_iterator instIter = itemsToInstall.begin();
426  instIter != itemsToInstall.end(); instIter++) {
427  // Requires
428  for (Capabilities::const_iterator capIt = (*instIter)->dep (Dep::REQUIRES).begin(); capIt != (*instIter)->dep (Dep::REQUIRES).end(); ++capIt)
429  {
430  sat::WhatProvides possibleProviders(*capIt);
431  for_( iter, possibleProviders.begin(), possibleProviders.end() ) {
432  PoolItem provider = ResPool::instance().find( *iter );
433 
434  // searching if this provider will already be installed
435  bool found = false;
436  bool alreadySetForInstallation = false;
437  ItemCapKindMap::const_iterator pos = _isInstalledBy.find(provider);
438  while (pos != _isInstalledBy.end()
439  && pos->first == provider
440  && !found) {
441  alreadySetForInstallation = true;
442  ItemCapKind capKind = pos->second;
443  if (capKind.item() == *instIter) found = true;
444  pos++;
445  }
446 
447  if (!found
448  && provider.status().isToBeInstalled()) {
449  if (provider.status().isBySolver()) {
450  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::REQUIRES, !alreadySetForInstallation );
451  _isInstalledBy.insert (make_pair( provider, capKindisInstalledBy));
452  } else {
453  // no initial installation cause it has been set be e.g. user
454  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::REQUIRES, false );
455  _isInstalledBy.insert (make_pair( provider, capKindisInstalledBy));
456  }
457  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::REQUIRES, !alreadySetForInstallation );
458  _installs.insert (make_pair( *instIter, capKindisInstalledBy));
459  }
460 
461  if (provider.status().staysInstalled()) { // Is already satisfied by an item which is installed
462  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::REQUIRES, false );
463  _satifiedByInstalled.insert (make_pair( *instIter, capKindisInstalledBy));
464 
465  ItemCapKind installedSatisfied( *instIter, *capIt, Dep::REQUIRES, false );
466  _installedSatisfied.insert (make_pair( provider, installedSatisfied));
467  }
468  }
469  }
470 
471  if (!(_satResolver->onlyRequires())) {
472  //Recommends
473  for (Capabilities::const_iterator capIt = (*instIter)->dep (Dep::RECOMMENDS).begin(); capIt != (*instIter)->dep (Dep::RECOMMENDS).end(); ++capIt)
474  {
475  sat::WhatProvides possibleProviders(*capIt);
476  for_( iter, possibleProviders.begin(), possibleProviders.end() ) {
477  PoolItem provider = ResPool::instance().find( *iter );
478 
479  // searching if this provider will already be installed
480  bool found = false;
481  bool alreadySetForInstallation = false;
482  ItemCapKindMap::const_iterator pos = _isInstalledBy.find(provider);
483  while (pos != _isInstalledBy.end()
484  && pos->first == provider
485  && !found) {
486  alreadySetForInstallation = true;
487  ItemCapKind capKind = pos->second;
488  if (capKind.item() == *instIter) found = true;
489  pos++;
490  }
491 
492  if (!found
493  && provider.status().isToBeInstalled()) {
494  if (provider.status().isBySolver()) {
495  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::RECOMMENDS, !alreadySetForInstallation );
496  _isInstalledBy.insert (make_pair( provider, capKindisInstalledBy));
497  } else {
498  // no initial installation cause it has been set be e.g. user
499  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::RECOMMENDS, false );
500  _isInstalledBy.insert (make_pair( provider, capKindisInstalledBy));
501  }
502  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::RECOMMENDS, !alreadySetForInstallation );
503  _installs.insert (make_pair( *instIter, capKindisInstalledBy));
504  }
505 
506  if (provider.status().staysInstalled()) { // Is already satisfied by an item which is installed
507  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::RECOMMENDS, false );
508  _satifiedByInstalled.insert (make_pair( *instIter, capKindisInstalledBy));
509 
510  ItemCapKind installedSatisfied( *instIter, *capIt, Dep::RECOMMENDS, false );
511  _installedSatisfied.insert (make_pair( provider, installedSatisfied));
512  }
513  }
514  }
515 
516  //Supplements
517  for (Capabilities::const_iterator capIt = (*instIter)->dep (Dep::SUPPLEMENTS).begin(); capIt != (*instIter)->dep (Dep::SUPPLEMENTS).end(); ++capIt)
518  {
519  sat::WhatProvides possibleProviders(*capIt);
520  for_( iter, possibleProviders.begin(), possibleProviders.end() ) {
521  PoolItem provider = ResPool::instance().find( *iter );
522  // searching if this item will already be installed
523  bool found = false;
524  bool alreadySetForInstallation = false;
525  ItemCapKindMap::const_iterator pos = _isInstalledBy.find(*instIter);
526  while (pos != _isInstalledBy.end()
527  && pos->first == *instIter
528  && !found) {
529  alreadySetForInstallation = true;
530  ItemCapKind capKind = pos->second;
531  if (capKind.item() == provider) found = true;
532  pos++;
533  }
534 
535  if (!found
536  && instIter->status().isToBeInstalled()) {
537  if (instIter->status().isBySolver()) {
538  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::SUPPLEMENTS, !alreadySetForInstallation );
539  _isInstalledBy.insert (make_pair( *instIter, capKindisInstalledBy));
540  } else {
541  // no initial installation cause it has been set be e.g. user
542  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::SUPPLEMENTS, false );
543  _isInstalledBy.insert (make_pair( *instIter, capKindisInstalledBy));
544  }
545  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::SUPPLEMENTS, !alreadySetForInstallation );
546  _installs.insert (make_pair( provider, capKindisInstalledBy));
547  }
548 
549  if (instIter->status().staysInstalled()) { // Is already satisfied by an item which is installed
550  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::SUPPLEMENTS, !alreadySetForInstallation );
551  _satifiedByInstalled.insert (make_pair( provider, capKindisInstalledBy));
552 
553  ItemCapKind installedSatisfied( provider, *capIt, Dep::SUPPLEMENTS, false );
554  _installedSatisfied.insert (make_pair( *instIter, installedSatisfied));
555  }
556  }
557  }
558  }
559  }
560  }
561 }
562 
563 
564 ItemCapKindList Resolver::isInstalledBy( const PoolItem & item )
565 {
566  ItemCapKindList ret;
567  collectResolverInfo();
568 
569  for (ItemCapKindMap::const_iterator iter = _isInstalledBy.find(item); iter != _isInstalledBy.end();) {
570  ItemCapKind info = iter->second;
571  PoolItem iterItem = iter->first;
572  if (iterItem == item) {
573  ret.push_back(info);
574  iter++;
575  } else {
576  // exit
577  iter = _isInstalledBy.end();
578  }
579  }
580  return ret;
581 }
582 
583 ItemCapKindList Resolver::installs( const PoolItem & item )
584 {
585  ItemCapKindList ret;
586  collectResolverInfo();
587 
588  for (ItemCapKindMap::const_iterator iter = _installs.find(item); iter != _installs.end();) {
589  ItemCapKind info = iter->second;
590  PoolItem iterItem = iter->first;
591  if (iterItem == item) {
592  ret.push_back(info);
593  iter++;
594  } else {
595  // exit
596  iter = _installs.end();
597  }
598  }
599  return ret;
600 }
601 
602 ItemCapKindList Resolver::satifiedByInstalled( const PoolItem & item )
603 {
604  ItemCapKindList ret;
605  collectResolverInfo();
606 
607  for (ItemCapKindMap::const_iterator iter = _satifiedByInstalled.find(item); iter != _satifiedByInstalled.end();) {
608  ItemCapKind info = iter->second;
609  PoolItem iterItem = iter->first;
610  if (iterItem == item) {
611  ret.push_back(info);
612  iter++;
613  } else {
614  // exit
615  iter = _satifiedByInstalled.end();
616  }
617  }
618  return ret;
619 }
620 
621 ItemCapKindList Resolver::installedSatisfied( const PoolItem & item )
622 {
623  ItemCapKindList ret;
624  collectResolverInfo();
625 
626  for (ItemCapKindMap::const_iterator iter = _installedSatisfied.find(item); iter != _installedSatisfied.end();) {
627  ItemCapKind info = iter->second;
628  PoolItem iterItem = iter->first;
629  if (iterItem == item) {
630  ret.push_back(info);
631  iter++;
632  } else {
633  // exit
634  iter = _installedSatisfied.end();
635  }
636  }
637  return ret;
638 }
639 
640 
642  };// namespace detail
645  };// namespace solver
648 };// namespace zypp
650 
zypp::sat::Pool::instance
static Pool instance()
Singleton ctor.
Definition: Pool.h:55
zypp::PoolItem
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
zypp::solver::detail::dupAllowDowngrade
dupAllowDowngrade
Definition: Resolver.cc:121
zypp::Dep::SUPPLEMENTS
static const Dep SUPPLEMENTS
Definition: Dep.h:50
zypp::ResStatus::APPL_HIGH
Definition: ResStatus.h:110
Resolver.h
zypp::Resolver::doUpdate
void doUpdate()
Update to newest package.
Definition: Resolver.cc:78
Transaction.h
zypp::Resolver::setOnlyRequires
void setOnlyRequires(bool yesno_r)
Setting whether required packages are installed ONLY So recommended packages, language packages and p...
Definition: Resolver.cc:90
zypp::Resolver::undo
void undo()
Definition: Resolver.cc:63
zypp::solver::detail::UndoTransact::UndoTransact
UndoTransact(const ResStatus::TransactByValue &status)
Definition: Resolver.cc:229
zypp::base::ReferenceCounted::dumpOn
virtual std::ostream & dumpOn(std::ostream &str) const
Overload to realize std::ostream & operator<<.
Definition: ReferenceCounted.cc:47
zypp::ResolverFocus::Default
Request the standard behavior (as defined in zypp.conf or 'Job')
zypp::Resolver::Resolver
Resolver(const ResPool &pool)
Ctor.
Definition: Resolver.cc:37
OUTS
#define OUTS(t)
zypp::ZConfig::solver_onlyRequires
bool solver_onlyRequires() const
Solver regards required packages,patterns,...
Definition: ZConfig.cc:1083
ZConfig.h
zypp::Resolver::doUpgrade
bool doUpgrade()
Do an distribution upgrade (DUP)
Definition: Resolver.cc:75
MIL
#define MIL
Definition: Logger.h:79
SolverQueueItem.h
zypp::solver::detail::allowVendorChange
allowVendorChange
Definition: Resolver.cc:119
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:37
zypp::solver::detail::DoTransact::operator()
bool operator()(PoolItem item)
Definition: Resolver.cc:248
zypp::ResStatus::TransactByValue
TransactByValue
Definition: ResStatus.h:106
zypp::solver::detail::_dup_allowdowngrade
_dup_allowdowngrade
Definition: Resolver.cc:121
zypp::ProblemSolutionList
std::list< ProblemSolution_Ptr > ProblemSolutionList
Definition: ProblemTypes.h:43
zypp::ResolverFocus
ResolverFocus
The resolvers general attitude.
Definition: ResolverFocus.h:21
zypp::Dep::REQUIRES
static const Dep REQUIRES
Definition: Dep.h:44
zypp::ResStatus::resetTransact
bool resetTransact(TransactByValue causer_r)
Not the same as setTransact( false ).
Definition: ResStatus.h:485
zypp::Resolver::setCleandepsOnRemove
void setCleandepsOnRemove(bool yesno_r)
Cleanup when deleting packages.
Definition: Resolver.cc:108
zypp::Resolver::isInstalledBy
solver::detail::ItemCapKindList isInstalledBy(const PoolItem &item)
Gives information about WHO has pused an installation of an given item.
Definition: Resolver.cc:156
zypp::solver::detail::DoTransact::DoTransact
DoTransact(const ResStatus::TransactByValue &status)
Definition: Resolver.cc:244
bool
zypp::Resolver::resolveQueue
bool resolveQueue(solver::detail::SolverQueueItemList &queue)
Resolve package dependencies:
Definition: Resolver.cc:60
zypp::Resolver::problematicUpdateItems
std::list< PoolItem > problematicUpdateItems() const
Unmaintained packages which does not fit to the updated system (broken dependencies) will be deleted.
Definition: Resolver.cc:147
zypp::ZConfig::solver_cleandepsOnRemove
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
Definition: ZConfig.cc:1094
zypp::ZConfig::solver_focus
ResolverFocus solver_focus() const
The resolvers general attitude when resolving jobs.
Definition: ZConfig.cc:1081
LogTools.h
zypp::Resolver::installedSatisfied
solver::detail::ItemCapKindList installedSatisfied(const PoolItem &item)
Gives information about WHICH items require an already installed item.
Definition: Resolver.cc:165
zypp::Resolver::problems
ResolverProblemList problems()
Return the dependency problems found by the last call to resolveDependencies().
Definition: Resolver.cc:66
zypp::solver::detail::UndoTransact::resStatus
ResStatus::TransactByValue resStatus
Definition: Resolver.cc:228
zypp::solver::detail::ZOLV_FLAG_TRIBOOL
ZOLV_FLAG_TRIBOOL(setAllowNameChange, allowNameChange, _allownamechange, true) ZOLV_FLAG_TRIBOOL(setAllowVendorChange
zypp::solver::detail::SolverQueueItemList
std::list< SolverQueueItem_Ptr > SolverQueueItemList
Definition: Types.h:45
zypp::Resolver::applySolutions
void applySolutions(const ProblemSolutionList &solutions)
Apply problem solutions.
Definition: Resolver.cc:69
Algorithm.h
zypp::solver::detail::UndoTransact
Definition: Resolver.cc:226
WAR
#define WAR
Definition: Logger.h:80
zypp::sat::Transaction::loadFromPool
static constexpr LoadFromPoolType loadFromPool
Definition: Transaction.h:82
zypp::invokeOnEach
int invokeOnEach(TIterator begin_r, TIterator end_r, TFilter filter_r, TFunction fnc_r)
Iterate through [begin_r,end_r) and invoke fnc_r on each item that passes filter_r.
Definition: Algorithm.h:30
ItemCapKind.h
zypp::resfilter::ByTransact
Select PoolItem by transact.
Definition: ResFilters.h:306
zypp::ZConfig::instance
static ZConfig & instance()
Singleton ctor.
Definition: Resolver.cc:124
zypp::Resolver::satifiedByInstalled
solver::detail::ItemCapKindList satifiedByInstalled(const PoolItem &item)
Gives information about WHICH installed items are requested by the installation of an item.
Definition: Resolver.cc:162
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1
zypp::ZConfig
Interim helper class to collect global options and settings.
Definition: ZConfig.h:59
zypp::Dep::RECOMMENDS
static const Dep RECOMMENDS
Definition: Dep.h:47
SolutionAction.h
zypp::solver::detail::DoTransact
Definition: Resolver.cc:241
zypp::solver::detail::dupAllowArchChange
dupAllowArchChange
Definition: Resolver.cc:123
zypp::ResPool::find
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: ResPool.cc:73
zypp::Resolver::~Resolver
virtual ~Resolver()
Dtor.
Definition: Resolver.cc:46
zypp::Resolver::focus
ResolverFocus focus() const
Definition: Resolver.cc:82
zypp::ResolverProblemList
std::list< ResolverProblem_Ptr > ResolverProblemList
Definition: ProblemTypes.h:46
zypp::solver::detail::UndoTransact::operator()
bool operator()(PoolItem item)
Definition: Resolver.cc:233
zypp::ResStatus::setTransact
bool setTransact(bool toTansact_r, TransactByValue causer_r)
Toggle between TRANSACT and KEEP_STATE.
Definition: ResStatus.h:433
zypp::Resolver::reset
void reset()
Definition: Resolver.cc:168
zypp::solver::detail::DoTransact::resStatus
ResStatus::TransactByValue resStatus
Definition: Resolver.cc:243
zypp::ResPool
Global ResObject pool.
Definition: ResPool.h:60
zypp::PoolItem::status
ResStatus & status() const
Returns the current status.
Definition: PoolItem.cc:204
for_
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:28
zypp::ResStatus::APPL_LOW
Definition: ResStatus.h:109
DBG
#define DBG
Definition: Logger.h:78
zypp::Resolver::verifySystem
bool verifySystem()
Resolve package dependencies:
Definition: Resolver.cc:54
zypp::Resolver::installs
solver::detail::ItemCapKindList installs(const PoolItem &item)
Gives information about WHICH additional items will be installed due the installation of an item.
Definition: Resolver.cc:159
zypp::resfilter::PoolItemFilterFunctor
std::unary_function< PoolItem, bool > PoolItemFilterFunctor
Definition: ResFilters.h:285
Testcase.h
zypp::TriBool
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition: String.h:30
zypp::solver::detail::_dup_allowvendorchange
_dup_allowvendorchange
Definition: Resolver.cc:124
zypp::solver::detail::ItemCapKindList
std::list< ItemCapKind > ItemCapKindList
Definition: Types.h:41
zypp::Resolver::resolvePool
bool resolvePool()
Resolve package dependencies:
Definition: Resolver.cc:57
zypp::solver::detail::_dup_allownamechange
_dup_allownamechange
Definition: Resolver.cc:122
SATResolver.h
zypp::solver::detail::dupAllowNameChange
dupAllowNameChange
Definition: Resolver.cc:122
zypp::solver::detail::dupAllowVendorChange
dupAllowVendorChange
Definition: Resolver.cc:124
zypp::solver::detail::_allowvendorchange
_allowvendorchange
Definition: Resolver.cc:119
zypp::solver::detail::_dup_allowarchchange
_dup_allowarchchange
Definition: Resolver.cc:123
zypp::Resolver::getTransaction
sat::Transaction getTransaction()
Return the Transaction computed by the last solver run.
Definition: Resolver.cc:72
zypp::Resolver::setFocus
void setFocus(ResolverFocus focus_r)
Define the resolvers general attitude when resolving jobs.
Definition: Resolver.cc:81