libzypp  17.25.1
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 
57 //---------------------------------------------------------------------------
58 
59 
60 std::ostream & Resolver::dumpOn( std::ostream & os ) const
61 {
62  os << "<resolver>" << endl;
63  #define OUTS(t) os << " " << #t << ":\t" << t << endl;
64  OUTS( _upgradeMode );
65  OUTS( _updateMode );
66  OUTS( _verifying );
67  OUTS( _onlyRequires );
68  OUTS( _solveSrcPackages );
69  OUTS( _cleandepsOnRemove );
70  OUTS( _ignoreAlreadyRecommended );
71  #undef OUT
72  return os << "<resolver/>";
73 }
74 
75 
76 //---------------------------------------------------------------------------
77 
78 Resolver::Resolver (const ResPool & pool)
79  : _pool(pool)
80  , _satResolver(NULL)
81  , _poolchanged(_pool.serial() )
82  , _upgradeMode (false)
83  , _updateMode (false)
84  , _verifying (false)
85  , _onlyRequires ( ZConfig::instance().solver_onlyRequires() )
86  , _solveSrcPackages ( false )
87  , _cleandepsOnRemove ( ZConfig::instance().solver_cleandepsOnRemove() )
88  , _ignoreAlreadyRecommended ( true )
89 {
90  sat::Pool satPool( sat::Pool::instance() );
91  _satResolver = new SATResolver(_pool, satPool.get());
92 }
93 
94 
96 {
97  delete _satResolver;
98 }
99 
101 { return _satResolver->get(); }
102 
103 //---------------------------------------------------------------------------
104 // forward flags too SATResolver
105 
106 void Resolver::setFocus( ResolverFocus focus_r ) { _satResolver->_focus = ( focus_r == ResolverFocus::Default ) ? ZConfig::instance().solver_focus() : focus_r; }
107 ResolverFocus Resolver::focus() const { return _satResolver->_focus; }
108 
109 #define ZOLV_FLAG_TRIBOOL( ZSETTER, ZGETTER, ZVARNAME, ZVARDEFAULT ) \
110  void Resolver::ZSETTER( TriBool state_r ) \
111  { _satResolver->ZVARNAME = indeterminate(state_r) ? ZVARDEFAULT : bool(state_r); } \
112  bool Resolver::ZGETTER() const \
113  { return _satResolver->ZVARNAME; } \
114 
115 // NOTE: ZVARDEFAULT must be in sync with SATResolver ctor
116 ZOLV_FLAG_TRIBOOL( setForceResolve, forceResolve, _allowuninstall, false )
117 
118 ZOLV_FLAG_TRIBOOL( setAllowDowngrade, allowDowngrade, _allowdowngrade, false )
119 ZOLV_FLAG_TRIBOOL( setAllowNameChange, allowNameChange, _allownamechange, true ) // bsc#1071466
120 ZOLV_FLAG_TRIBOOL( setAllowArchChange, allowArchChange, _allowarchchange, false )
121 ZOLV_FLAG_TRIBOOL( setAllowVendorChange, allowVendorChange, _allowvendorchange, ZConfig::instance().solver_allowVendorChange() )
122 
123 ZOLV_FLAG_TRIBOOL( dupSetAllowDowngrade, dupAllowDowngrade, _dup_allowdowngrade, ZConfig::instance().solver_dupAllowDowngrade() )
124 ZOLV_FLAG_TRIBOOL( dupSetAllowNameChange, dupAllowNameChange, _dup_allownamechange, ZConfig::instance().solver_dupAllowNameChange() )
125 ZOLV_FLAG_TRIBOOL( dupSetAllowArchChange, dupAllowArchChange, _dup_allowarchchange, ZConfig::instance().solver_dupAllowArchChange() )
126 ZOLV_FLAG_TRIBOOL( dupSetAllowVendorChange, dupAllowVendorChange, _dup_allowvendorchange, ZConfig::instance().solver_dupAllowVendorChange() )
127 
128 #undef ZOLV_FLAG_TRIBOOL
129 //---------------------------------------------------------------------------
130 
131 void Resolver::setOnlyRequires( TriBool state_r )
132 {
133  _onlyRequires = indeterminate(state_r) ? ZConfig::instance().solver_onlyRequires() : bool(state_r);
134 }
135 
137 {
138  _cleandepsOnRemove = indeterminate(state_r) ? ZConfig::instance().solver_cleandepsOnRemove() : bool(state_r);
139 }
140 
141 //---------------------------------------------------------------------------
142 
143 ResPool Resolver::pool() const
144 { return _pool; }
145 
146 void Resolver::reset( bool keepExtras )
147 {
148  _verifying = false;
149 
150  if (!keepExtras) {
151  _extra_requires.clear();
152  _extra_conflicts.clear();
153  }
154 
155  _isInstalledBy.clear();
156  _installs.clear();
157  _satifiedByInstalled.clear();
158  _installedSatisfied.clear();
159 }
160 
161 bool Resolver::doUpgrade()
162 {
163  // Setting Resolver to upgrade mode. SAT solver will do the update
164  _upgradeMode = true;
165  return resolvePool();
166 }
167 
168 void Resolver::doUpdate()
169 {
170  _updateMode = true;
171  return _satResolver->doUpdate();
172 }
173 
174 PoolItemList Resolver::problematicUpdateItems() const
175 { return _satResolver->problematicUpdateItems(); }
176 
177 void Resolver::addExtraRequire( const Capability & capability )
178 { _extra_requires.insert (capability); }
179 
180 void Resolver::removeExtraRequire( const Capability & capability )
181 { _extra_requires.erase (capability); }
182 
183 void Resolver::addExtraConflict( const Capability & capability )
184 { _extra_conflicts.insert (capability); }
185 
186 void Resolver::removeExtraConflict( const Capability & capability )
187 { _extra_conflicts.erase (capability); }
188 
189 void Resolver::removeQueueItem( SolverQueueItem_Ptr item )
190 {
191  bool found = false;
192  for (SolverQueueItemList::const_iterator iter = _added_queue_items.begin();
193  iter != _added_queue_items.end(); iter++) {
194  if (*iter == item) {
195  _added_queue_items.remove(*iter);
196  found = true;
197  break;
198  }
199  }
200  if (!found) {
201  _removed_queue_items.push_back (item);
202  _removed_queue_items.unique ();
203  }
204 }
205 
206 void Resolver::addQueueItem( SolverQueueItem_Ptr item )
207 {
208  bool found = false;
209  for (SolverQueueItemList::const_iterator iter = _removed_queue_items.begin();
210  iter != _removed_queue_items.end(); iter++) {
211  if (*iter == item) {
212  _removed_queue_items.remove(*iter);
213  found = true;
214  break;
215  }
216  }
217  if (!found) {
218  _added_queue_items.push_back (item);
219  _added_queue_items.unique ();
220  }
221 }
222 
223 void Resolver::addWeak( const PoolItem & item )
224 { _addWeak.push_back( item ); }
225 
226 //---------------------------------------------------------------------------
227 
229 {
232  :resStatus(status)
233  { }
234 
235  bool operator()( PoolItem item ) // only transacts() items go here
236  {
237  item.status().resetTransact( resStatus );// clear any solver/establish transactions
238  return true;
239  }
240 };
241 
242 
244 {
247  :resStatus(status)
248  { }
249 
250  bool operator()( PoolItem item ) // only transacts() items go here
251  {
252  item.status().setTransact( true, resStatus );
253  return true;
254  }
255 };
256 
257 
259 {
260  UndoTransact resetting (ResStatus::APPL_HIGH);
261 
262  DBG << "Resolver::verifySystem()" << endl;
263 
264  _verifying = true;
265 
266  invokeOnEach ( _pool.begin(), _pool.end(),
267  resfilter::ByTransact( ), // Resetting all transcations
268  functor::functorRef<bool,PoolItem>(resetting) );
269 
270  return resolvePool();
271 }
272 
273 
274 //----------------------------------------------------------------------------
275 // undo
276 void Resolver::undo()
277 {
278  UndoTransact info(ResStatus::APPL_LOW);
279  MIL << "*** undo ***" << endl;
280  invokeOnEach ( _pool.begin(), _pool.end(),
281  resfilter::ByTransact( ), // collect transacts from Pool to resolver queue
282  functor::functorRef<bool,PoolItem>(info) );
283  // Regard dependencies of the item weak onl
284  _addWeak.clear();
285 
286  // Additional QueueItems which has to be regarded by the solver
287  _removed_queue_items.clear();
288  _added_queue_items.clear();
289 
290  return;
291 }
292 
293 void Resolver::solverInit()
294 {
295  // Solving with libsolv
296  static bool poolDumped = false;
297  MIL << "-------------- Calling SAT Solver -------------------" << endl;
298  if ( getenv("ZYPP_FULLLOG") ) {
299  Testcase testcase("/var/log/YaST2/autoTestcase");
300  if (!poolDumped) {
301  testcase.createTestcase (*this, true, false); // dump pool
302  poolDumped = true;
303  } else {
304  testcase.createTestcase (*this, false, false); // write control file only
305  }
306  }
307 
308  _satResolver->setFixsystem ( isVerifyingMode() );
309  _satResolver->setIgnorealreadyrecommended ( ignoreAlreadyRecommended() );
310  _satResolver->setOnlyRequires ( onlyRequires() );
311  _satResolver->setUpdatesystem (_updateMode);
312  _satResolver->setSolveSrcPackages ( solveSrcPackages() );
313  _satResolver->setCleandepsOnRemove ( cleandepsOnRemove() );
314 
315  _satResolver->setDistupgrade (_upgradeMode);
316  if (_upgradeMode) {
317  // may overwrite some settings
318  _satResolver->setDistupgrade_removeunsupported (false);
319  }
320 
321  // Resetting additional solver information
322  _isInstalledBy.clear();
323  _installs.clear();
324  _satifiedByInstalled.clear();
325  _installedSatisfied.clear();
326 }
327 
329 {
330  solverInit();
331  return _satResolver->resolvePool(_extra_requires, _extra_conflicts, _addWeak, _upgradeRepos );
332 }
333 
335 {
336  solverInit();
337 
338  // add/remove additional SolverQueueItems
339  for (SolverQueueItemList::const_iterator iter = _removed_queue_items.begin();
340  iter != _removed_queue_items.end(); iter++) {
341  for (SolverQueueItemList::const_iterator iterQueue = queue.begin(); iterQueue != queue.end(); iterQueue++) {
342  if ( (*iterQueue)->cmp(*iter) == 0) {
343  MIL << "remove from queue" << *iter;
344  queue.remove(*iterQueue);
345  break;
346  }
347  }
348  }
349 
350  for (SolverQueueItemList::const_iterator iter = _added_queue_items.begin();
351  iter != _added_queue_items.end(); iter++) {
352  bool found = false;
353  for (SolverQueueItemList::const_iterator iterQueue = queue.begin(); iterQueue != queue.end(); iterQueue++) {
354  if ( (*iterQueue)->cmp(*iter) == 0) {
355  found = true;
356  break;
357  }
358  }
359  if (!found) {
360  MIL << "add to queue" << *iter;
361  queue.push_back(*iter);
362  }
363  }
364 
365  // The application has to take care to write these solutions back to e.g. selectables in order
366  // give the user a chance for changing these decisions again.
367  _removed_queue_items.clear();
368  _added_queue_items.clear();
369 
370  return _satResolver->resolveQueue(queue, _addWeak);
371 }
372 
373 sat::Transaction Resolver::getTransaction()
374 {
375  // FIXME: That's an ugly way of pushing autoInstalled into the transaction.
376  sat::Transaction ret( sat::Transaction::loadFromPool );
377  ret.autoInstalled( _satResolver->autoInstalled() );
378  return ret;
379 }
380 
381 
382 //----------------------------------------------------------------------------
383 // Getting more information about the solve results
384 
386 {
387  MIL << "Resolver::problems()" << endl;
388  return _satResolver->problems();
389 }
390 
391 void Resolver::applySolutions( const ProblemSolutionList & solutions )
392 {
393  for ( ProblemSolution_Ptr solution : solutions )
394  {
395  if ( ! applySolution( *solution ) )
396  break;
397  }
398 }
399 
400 bool Resolver::applySolution( const ProblemSolution & solution )
401 {
402  bool ret = true;
403  DBG << "apply solution " << solution << endl;
404  for ( SolutionAction_Ptr action : solution.actions() )
405  {
406  if ( ! action->execute( *this ) )
407  {
408  WAR << "apply solution action failed: " << action << endl;
409  ret = false;
410  break;
411  }
412  }
413  return ret;
414 }
415 
416 //----------------------------------------------------------------------------
417 
418 void Resolver::collectResolverInfo()
419 {
420  if ( _satResolver
421  && _isInstalledBy.empty()
422  && _installs.empty()) {
423 
424  // generating new
425  PoolItemList itemsToInstall = _satResolver->resultItemsToInstall();
426 
427  for (PoolItemList::const_iterator instIter = itemsToInstall.begin();
428  instIter != itemsToInstall.end(); instIter++) {
429  // Requires
430  for (Capabilities::const_iterator capIt = (*instIter)->dep (Dep::REQUIRES).begin(); capIt != (*instIter)->dep (Dep::REQUIRES).end(); ++capIt)
431  {
432  sat::WhatProvides possibleProviders(*capIt);
433  for_( iter, possibleProviders.begin(), possibleProviders.end() ) {
434  PoolItem provider = ResPool::instance().find( *iter );
435 
436  // searching if this provider will already be installed
437  bool found = false;
438  bool alreadySetForInstallation = false;
439  ItemCapKindMap::const_iterator pos = _isInstalledBy.find(provider);
440  while (pos != _isInstalledBy.end()
441  && pos->first == provider
442  && !found) {
443  alreadySetForInstallation = true;
444  ItemCapKind capKind = pos->second;
445  if (capKind.item() == *instIter) found = true;
446  pos++;
447  }
448 
449  if (!found
450  && provider.status().isToBeInstalled()) {
451  if (provider.status().isBySolver()) {
452  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::REQUIRES, !alreadySetForInstallation );
453  _isInstalledBy.insert (make_pair( provider, capKindisInstalledBy));
454  } else {
455  // no initial installation cause it has been set be e.g. user
456  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::REQUIRES, false );
457  _isInstalledBy.insert (make_pair( provider, capKindisInstalledBy));
458  }
459  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::REQUIRES, !alreadySetForInstallation );
460  _installs.insert (make_pair( *instIter, capKindisInstalledBy));
461  }
462 
463  if (provider.status().staysInstalled()) { // Is already satisfied by an item which is installed
464  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::REQUIRES, false );
465  _satifiedByInstalled.insert (make_pair( *instIter, capKindisInstalledBy));
466 
467  ItemCapKind installedSatisfied( *instIter, *capIt, Dep::REQUIRES, false );
468  _installedSatisfied.insert (make_pair( provider, installedSatisfied));
469  }
470  }
471  }
472 
473  if (!(_satResolver->onlyRequires())) {
474  //Recommends
475  for (Capabilities::const_iterator capIt = (*instIter)->dep (Dep::RECOMMENDS).begin(); capIt != (*instIter)->dep (Dep::RECOMMENDS).end(); ++capIt)
476  {
477  sat::WhatProvides possibleProviders(*capIt);
478  for_( iter, possibleProviders.begin(), possibleProviders.end() ) {
479  PoolItem provider = ResPool::instance().find( *iter );
480 
481  // searching if this provider will already be installed
482  bool found = false;
483  bool alreadySetForInstallation = false;
484  ItemCapKindMap::const_iterator pos = _isInstalledBy.find(provider);
485  while (pos != _isInstalledBy.end()
486  && pos->first == provider
487  && !found) {
488  alreadySetForInstallation = true;
489  ItemCapKind capKind = pos->second;
490  if (capKind.item() == *instIter) found = true;
491  pos++;
492  }
493 
494  if (!found
495  && provider.status().isToBeInstalled()) {
496  if (provider.status().isBySolver()) {
497  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::RECOMMENDS, !alreadySetForInstallation );
498  _isInstalledBy.insert (make_pair( provider, capKindisInstalledBy));
499  } else {
500  // no initial installation cause it has been set be e.g. user
501  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::RECOMMENDS, false );
502  _isInstalledBy.insert (make_pair( provider, capKindisInstalledBy));
503  }
504  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::RECOMMENDS, !alreadySetForInstallation );
505  _installs.insert (make_pair( *instIter, capKindisInstalledBy));
506  }
507 
508  if (provider.status().staysInstalled()) { // Is already satisfied by an item which is installed
509  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::RECOMMENDS, false );
510  _satifiedByInstalled.insert (make_pair( *instIter, capKindisInstalledBy));
511 
512  ItemCapKind installedSatisfied( *instIter, *capIt, Dep::RECOMMENDS, false );
513  _installedSatisfied.insert (make_pair( provider, installedSatisfied));
514  }
515  }
516  }
517 
518  //Supplements
519  for (Capabilities::const_iterator capIt = (*instIter)->dep (Dep::SUPPLEMENTS).begin(); capIt != (*instIter)->dep (Dep::SUPPLEMENTS).end(); ++capIt)
520  {
521  sat::WhatProvides possibleProviders(*capIt);
522  for_( iter, possibleProviders.begin(), possibleProviders.end() ) {
523  PoolItem provider = ResPool::instance().find( *iter );
524  // searching if this item will already be installed
525  bool found = false;
526  bool alreadySetForInstallation = false;
527  ItemCapKindMap::const_iterator pos = _isInstalledBy.find(*instIter);
528  while (pos != _isInstalledBy.end()
529  && pos->first == *instIter
530  && !found) {
531  alreadySetForInstallation = true;
532  ItemCapKind capKind = pos->second;
533  if (capKind.item() == provider) found = true;
534  pos++;
535  }
536 
537  if (!found
538  && instIter->status().isToBeInstalled()) {
539  if (instIter->status().isBySolver()) {
540  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::SUPPLEMENTS, !alreadySetForInstallation );
541  _isInstalledBy.insert (make_pair( *instIter, capKindisInstalledBy));
542  } else {
543  // no initial installation cause it has been set be e.g. user
544  ItemCapKind capKindisInstalledBy( provider, *capIt, Dep::SUPPLEMENTS, false );
545  _isInstalledBy.insert (make_pair( *instIter, capKindisInstalledBy));
546  }
547  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::SUPPLEMENTS, !alreadySetForInstallation );
548  _installs.insert (make_pair( provider, capKindisInstalledBy));
549  }
550 
551  if (instIter->status().staysInstalled()) { // Is already satisfied by an item which is installed
552  ItemCapKind capKindisInstalledBy( *instIter, *capIt, Dep::SUPPLEMENTS, !alreadySetForInstallation );
553  _satifiedByInstalled.insert (make_pair( provider, capKindisInstalledBy));
554 
555  ItemCapKind installedSatisfied( provider, *capIt, Dep::SUPPLEMENTS, false );
556  _installedSatisfied.insert (make_pair( *instIter, installedSatisfied));
557  }
558  }
559  }
560  }
561  }
562  }
563 }
564 
565 
566 ItemCapKindList Resolver::isInstalledBy( const PoolItem & item )
567 {
568  ItemCapKindList ret;
569  collectResolverInfo();
570 
571  for (ItemCapKindMap::const_iterator iter = _isInstalledBy.find(item); iter != _isInstalledBy.end();) {
572  ItemCapKind info = iter->second;
573  PoolItem iterItem = iter->first;
574  if (iterItem == item) {
575  ret.push_back(info);
576  iter++;
577  } else {
578  // exit
579  iter = _isInstalledBy.end();
580  }
581  }
582  return ret;
583 }
584 
585 ItemCapKindList Resolver::installs( const PoolItem & item )
586 {
587  ItemCapKindList ret;
588  collectResolverInfo();
589 
590  for (ItemCapKindMap::const_iterator iter = _installs.find(item); iter != _installs.end();) {
591  ItemCapKind info = iter->second;
592  PoolItem iterItem = iter->first;
593  if (iterItem == item) {
594  ret.push_back(info);
595  iter++;
596  } else {
597  // exit
598  iter = _installs.end();
599  }
600  }
601  return ret;
602 }
603 
604 ItemCapKindList Resolver::satifiedByInstalled( const PoolItem & item )
605 {
606  ItemCapKindList ret;
607  collectResolverInfo();
608 
609  for (ItemCapKindMap::const_iterator iter = _satifiedByInstalled.find(item); iter != _satifiedByInstalled.end();) {
610  ItemCapKind info = iter->second;
611  PoolItem iterItem = iter->first;
612  if (iterItem == item) {
613  ret.push_back(info);
614  iter++;
615  } else {
616  // exit
617  iter = _satifiedByInstalled.end();
618  }
619  }
620  return ret;
621 }
622 
623 ItemCapKindList Resolver::installedSatisfied( const PoolItem & item )
624 {
625  ItemCapKindList ret;
626  collectResolverInfo();
627 
628  for (ItemCapKindMap::const_iterator iter = _installedSatisfied.find(item); iter != _installedSatisfied.end();) {
629  ItemCapKind info = iter->second;
630  PoolItem iterItem = iter->first;
631  if (iterItem == item) {
632  ret.push_back(info);
633  iter++;
634  } else {
635  // exit
636  iter = _installedSatisfied.end();
637  }
638  }
639  return ret;
640 }
641 
642 
644  };// namespace detail
647  };// namespace solver
650 };// namespace zypp
652 
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:123
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:80
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:92
zypp::Resolver::undo
void undo()
Definition: Resolver.cc:65
zypp::solver::detail::UndoTransact::UndoTransact
UndoTransact(const ResStatus::TransactByValue &status)
Definition: Resolver.cc:231
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:36
OUTS
#define OUTS(t)
zypp::ZConfig::solver_onlyRequires
bool solver_onlyRequires() const
Solver regards required packages,patterns,...
Definition: ZConfig.cc:1077
ZConfig.h
zypp::Resolver::doUpgrade
bool doUpgrade()
Do an distribution upgrade (DUP)
Definition: Resolver.cc:77
MIL
#define MIL
Definition: Logger.h:79
SolverQueueItem.h
zypp::solver::detail::allowVendorChange
allowVendorChange
Definition: Resolver.cc:121
zypp::ResPool::instance
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:37
zypp::solver::detail::DoTransact::operator()
bool operator()(PoolItem item)
Definition: Resolver.cc:250
zypp::ResStatus::TransactByValue
TransactByValue
Definition: ResStatus.h:106
zypp::solver::detail::_dup_allowdowngrade
_dup_allowdowngrade
Definition: Resolver.cc:123
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::sat::detail::CSolver
::s_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
Definition: PoolMember.h:65
zypp::Resolver::setCleandepsOnRemove
void setCleandepsOnRemove(bool yesno_r)
Cleanup when deleting packages.
Definition: Resolver.cc:110
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:158
zypp::solver::detail::DoTransact::DoTransact
DoTransact(const ResStatus::TransactByValue &status)
Definition: Resolver.cc:246
bool
zypp::Resolver::resolveQueue
bool resolveQueue(solver::detail::SolverQueueItemList &queue)
Resolve package dependencies:
Definition: Resolver.cc:62
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:149
zypp::ZConfig::solver_cleandepsOnRemove
bool solver_cleandepsOnRemove() const
Whether removing a package should also remove no longer needed requirements.
Definition: ZConfig.cc:1088
zypp::ZConfig::solver_focus
ResolverFocus solver_focus() const
The resolvers general attitude when resolving jobs.
Definition: ZConfig.cc:1075
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:167
zypp::Resolver::problems
ResolverProblemList problems()
Return the dependency problems found by the last call to resolveDependencies().
Definition: Resolver.cc:68
zypp::solver::detail::UndoTransact::resStatus
ResStatus::TransactByValue resStatus
Definition: Resolver.cc:230
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:71
Algorithm.h
zypp::solver::detail::UndoTransact
Definition: Resolver.cc:228
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:126
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:164
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:243
zypp::solver::detail::dupAllowArchChange
dupAllowArchChange
Definition: Resolver.cc:125
zypp::ResPool::find
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: ResPool.cc:73
zypp::Resolver::get
sat::detail::CSolver * get() const
Expert backdoor.
Definition: Resolver.cc:53
zypp::Resolver::~Resolver
virtual ~Resolver()
Dtor.
Definition: Resolver.cc:45
zypp::Resolver::focus
ResolverFocus focus() const
Definition: Resolver.cc:84
zypp::ResolverProblemList
std::list< ResolverProblem_Ptr > ResolverProblemList
Definition: ProblemTypes.h:46
zypp::solver::detail::UndoTransact::operator()
bool operator()(PoolItem item)
Definition: Resolver.cc:235
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:170
zypp::solver::detail::DoTransact::resStatus
ResStatus::TransactByValue resStatus
Definition: Resolver.cc:245
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:56
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:161
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:126
zypp::solver::detail::ItemCapKindList
std::list< ItemCapKind > ItemCapKindList
Definition: Types.h:41
zypp::Resolver::resolvePool
bool resolvePool()
Resolve package dependencies:
Definition: Resolver.cc:59
zypp::solver::detail::_dup_allownamechange
_dup_allownamechange
Definition: Resolver.cc:124
SATResolver.h
zypp::solver::detail::dupAllowNameChange
dupAllowNameChange
Definition: Resolver.cc:124
zypp::solver::detail::dupAllowVendorChange
dupAllowVendorChange
Definition: Resolver.cc:126
zypp::solver::detail::_allowvendorchange
_allowvendorchange
Definition: Resolver.cc:121
zypp::solver::detail::_dup_allowarchchange
_dup_allowarchchange
Definition: Resolver.cc:125
zypp::Resolver::getTransaction
sat::Transaction getTransaction()
Return the Transaction computed by the last solver run.
Definition: Resolver.cc:74
zypp::Resolver::setFocus
void setFocus(ResolverFocus focus_r)
Define the resolvers general attitude when resolving jobs.
Definition: Resolver.cc:83