libzypp  16.22.5
SATResolver.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* SATResolver.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 the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19  * 02111-1307, USA.
20  */
21 extern "C"
22 {
23 #include <solv/repo_solv.h>
24 #include <solv/poolarch.h>
25 #include <solv/evr.h>
26 #include <solv/poolvendor.h>
27 #include <solv/policy.h>
28 #include <solv/bitmap.h>
29 #include <solv/queue.h>
30 }
31 
32 #define ZYPP_USE_RESOLVER_INTERNALS
33 
34 #include "zypp/base/LogTools.h"
35 #include "zypp/base/Gettext.h"
36 #include "zypp/base/Algorithm.h"
37 
38 #include "zypp/ZConfig.h"
39 #include "zypp/Product.h"
40 #include "zypp/sat/WhatProvides.h"
41 #include "zypp/sat/WhatObsoletes.h"
43 
46 
54 
55 #define XDEBUG(x) do { if (base::logger::isExcessive()) XXX << x << std::endl;} while (0)
56 
58 namespace zypp
59 {
60 
62  namespace env
63  {
64  inline bool HACKENV( const char * var_r, bool default_r )
65  {
66  bool ret = default_r;
67  const char * val = ::getenv( var_r );
68  if ( val )
69  {
70  ret = str::strToBool( val, default_r );
71  if ( ret != default_r )
72  INT << "HACKENV " << var_r << " = " << ret << endl;
73  }
74  return ret;
75  }
76  } // namespace env
78 
80  namespace solver
81  {
82  namespace detail
84  {
85 
87  namespace
88  {
89  inline void solverSetFocus( sat::detail::CSolver & satSolver_r, const ResolverFocus & focus_r )
90  {
91  switch ( focus_r )
92  {
93  case ResolverFocus::Default: // fallthrough to Job
94  case ResolverFocus::Job:
95  solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
96  solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
97  break;
99  solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 1 );
100  solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
101  break;
103  solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
104  solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 1 );
105  break;
106  }
107  }
108 
109  } //namespace
111 
112 
113 using namespace std;
114 
115 IMPL_PTR_TYPE(SATResolver);
116 
117 #define MAYBE_CLEANDEPS (cleandepsOnRemove()?SOLVER_CLEANDEPS:0)
118 
119 //---------------------------------------------------------------------------
120 // Callbacks for SAT policies
121 //---------------------------------------------------------------------------
122 
123 int vendorCheck( sat::detail::CPool *pool, Solvable *solvable1, Solvable *solvable2 )
124 {
125  return VendorAttr::instance().equivalent( IdString(solvable1->vendor),
126  IdString(solvable2->vendor) ) ? 0 : 1;
127 }
128 
129 
130 inline std::string itemToString( const PoolItem & item )
131 {
132  if ( !item )
133  return std::string();
134 
135  sat::Solvable slv( item.satSolvable() );
136  std::string ret( slv.asString() ); // n-v-r.a
137  if ( ! slv.isSystem() )
138  {
139  ret += "[";
140  ret += slv.repository().alias();
141  ret += "]";
142  }
143  return ret;
144 }
145 
146 inline PoolItem getPoolItem( Id id_r )
147 {
148  PoolItem ret( (sat::Solvable( id_r )) );
149  if ( !ret && id_r )
150  INT << "id " << id_r << " not found in ZYPP pool." << endl;
151  return ret;
152 }
153 
154 //---------------------------------------------------------------------------
155 
156 std::ostream &
157 SATResolver::dumpOn( std::ostream & os ) const
158 {
159  os << "<resolver>" << endl;
160  if (_satSolver) {
161 #define OUTS(X) os << " " << #X << "\t= " << solver_get_flag(_satSolver, SOLVER_FLAG_##X) << endl
162  OUTS( ALLOW_DOWNGRADE );
163  OUTS( ALLOW_ARCHCHANGE );
164  OUTS( ALLOW_VENDORCHANGE );
165  OUTS( ALLOW_NAMECHANGE );
166  OUTS( ALLOW_UNINSTALL );
167  OUTS( NO_UPDATEPROVIDE );
168  OUTS( SPLITPROVIDES );
169  OUTS( IGNORE_RECOMMENDED );
170  OUTS( ADD_ALREADY_RECOMMENDED );
171  OUTS( NO_INFARCHCHECK );
172  OUTS( KEEP_EXPLICIT_OBSOLETES );
173  OUTS( BEST_OBEY_POLICY );
174  OUTS( NO_AUTOTARGET );
175  OUTS( DUP_ALLOW_DOWNGRADE );
176  OUTS( DUP_ALLOW_ARCHCHANGE );
177  OUTS( DUP_ALLOW_VENDORCHANGE );
178  OUTS( DUP_ALLOW_NAMECHANGE );
179  OUTS( KEEP_ORPHANS );
180  OUTS( BREAK_ORPHANS );
181  OUTS( YUM_OBSOLETES );
182 #undef OUTS
183  os << " focus = " << _focus << endl;
184  os << " distupgrade = " << _distupgrade << endl;
185  os << " distupgrade_removeunsupported = " << _distupgrade_removeunsupported << endl;
186  os << " solveSrcPackages = " << _solveSrcPackages << endl;
187  os << " cleandepsOnRemove = " << _cleandepsOnRemove << endl;
188  os << " fixsystem = " << _fixsystem << endl;
189  } else {
190  os << "<NULL>";
191  }
192  return os << "<resolver/>" << endl;
193 }
194 
195 //---------------------------------------------------------------------------
196 
197 // NOTE: flag defaults must be in sync with ZVARDEFAULT in Resolver.cc
198 SATResolver::SATResolver (const ResPool & pool, sat::detail::CPool *satPool)
199  : _pool(pool)
200  , _satPool(satPool)
201  , _satSolver(NULL)
202  , _focus ( ZConfig::instance().solver_focus() )
203  , _fixsystem(false)
204  , _allowdowngrade ( false )
205  , _allownamechange ( true ) // bsc#1071466
206  , _allowarchchange ( false )
207  , _allowvendorchange ( ZConfig::instance().solver_allowVendorChange() )
208  , _allowuninstall ( false )
209  , _updatesystem(false)
210  , _noupdateprovide ( false )
211  , _dosplitprovides ( true )
212  , _onlyRequires(ZConfig::instance().solver_onlyRequires())
213  , _ignorealreadyrecommended(true)
214  , _distupgrade(false)
215  , _distupgrade_removeunsupported(false)
216  , _dup_allowdowngrade ( ZConfig::instance().solver_dupAllowDowngrade() )
217  , _dup_allownamechange ( ZConfig::instance().solver_dupAllowNameChange() )
218  , _dup_allowarchchange ( ZConfig::instance().solver_dupAllowArchChange() )
219  , _dup_allowvendorchange ( ZConfig::instance().solver_dupAllowVendorChange() )
220  , _solveSrcPackages(false)
221  , _cleandepsOnRemove(ZConfig::instance().solver_cleandepsOnRemove())
222 {
223 }
224 
225 
226 SATResolver::~SATResolver()
227 {
228  solverEnd();
229 }
230 
231 //---------------------------------------------------------------------------
232 
233 ResPool
234 SATResolver::pool (void) const
235 {
236  return _pool;
237 }
238 
239 //---------------------------------------------------------------------------
240 
241 // copy marked item from solution back to pool
242 // if data != NULL, set as APPL_LOW (from establishPool())
243 
244 static void
246 {
247  // resetting
248  item.status().resetTransact (causer);
249  item.status().resetWeak ();
250 
251  bool r;
252 
253  // installation/deletion
254  if (status.isToBeInstalled()) {
255  r = item.status().setToBeInstalled (causer);
256  XDEBUG("SATSolutionToPool install returns " << item << ", " << r);
257  }
258  else if (status.isToBeUninstalledDueToUpgrade()) {
259  r = item.status().setToBeUninstalledDueToUpgrade (causer);
260  XDEBUG("SATSolutionToPool upgrade returns " << item << ", " << r);
261  }
262  else if (status.isToBeUninstalled()) {
263  r = item.status().setToBeUninstalled (causer);
264  XDEBUG("SATSolutionToPool remove returns " << item << ", " << r);
265  }
266 
267  return;
268 }
269 
270 //----------------------------------------------------------------------------
271 //----------------------------------------------------------------------------
272 // resolvePool
273 //----------------------------------------------------------------------------
274 //----------------------------------------------------------------------------
283 {
284  SATCollectTransact( PoolItemList & items_to_install_r,
285  PoolItemList & items_to_remove_r,
286  PoolItemList & items_to_lock_r,
287  PoolItemList & items_to_keep_r,
288  bool solveSrcPackages_r )
289  : _items_to_install( items_to_install_r )
290  , _items_to_remove( items_to_remove_r )
291  , _items_to_lock( items_to_lock_r )
292  , _items_to_keep( items_to_keep_r )
293  , _solveSrcPackages( solveSrcPackages_r )
294  {
295  _items_to_install.clear();
296  _items_to_remove.clear();
297  _items_to_lock.clear();
298  _items_to_keep.clear();
299  }
300 
301  bool operator()( const PoolItem & item_r )
302  {
303 
304  ResStatus & itemStatus( item_r.status() );
305  bool by_solver = ( itemStatus.isBySolver() || itemStatus.isByApplLow() );
306 
307  if ( by_solver )
308  {
309  // Clear former solver/establish resultd
310  itemStatus.resetTransact( ResStatus::APPL_LOW );
311  return true; // -> back out here, don't re-queue former results
312  }
313 
314  if ( !_solveSrcPackages && item_r.isKind<SrcPackage>() )
315  {
316  // Later we may continue on a per source package base.
317  return true; // dont process this source package.
318  }
319 
320  switch ( itemStatus.getTransactValue() )
321  {
322  case ResStatus::TRANSACT:
323  itemStatus.isUninstalled() ? _items_to_install.push_back( item_r )
324  : _items_to_remove.push_back( item_r ); break;
325  case ResStatus::LOCKED: _items_to_lock.push_back( item_r ); break;
326  case ResStatus::KEEP_STATE: _items_to_keep.push_back( item_r ); break;
327  }
328  return true;
329  }
330 
331 private:
332  PoolItemList & _items_to_install;
333  PoolItemList & _items_to_remove;
334  PoolItemList & _items_to_lock;
335  PoolItemList & _items_to_keep;
337 
338 };
340 
341 
342 //----------------------------------------------------------------------------
343 //----------------------------------------------------------------------------
344 // solving.....
345 //----------------------------------------------------------------------------
346 //----------------------------------------------------------------------------
347 
348 
350 {
351  public:
354 
355  CheckIfUpdate( const sat::Solvable & installed_r )
356  : is_updated( false )
357  , _installed( installed_r )
358  {}
359 
360  // check this item will be updated
361 
362  bool operator()( const PoolItem & item )
363  {
364  if ( item.status().isToBeInstalled() )
365  {
366  if ( ! item.multiversionInstall() || sameNVRA( _installed, item ) )
367  {
368  is_updated = true;
369  return false;
370  }
371  }
372  return true;
373  }
374 };
375 
376 
378 {
379  public:
381 
382  CollectPseudoInstalled( Queue *queue )
383  :solvableQueue (queue)
384  {}
385 
386  // collecting PseudoInstalled items
387  bool operator()( PoolItem item )
388  {
389  if ( traits::isPseudoInstalled( item.satSolvable().kind() ) )
390  queue_push( solvableQueue, item.satSolvable().id() );
391  return true;
392  }
393 };
394 
395 bool
396 SATResolver::solving(const CapabilitySet & requires_caps,
397  const CapabilitySet & conflict_caps)
398 {
399  _satSolver = solver_create( _satPool );
400  ::pool_set_custom_vendorcheck( _satPool, &vendorCheck );
401  if (_fixsystem) {
402  queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
403  queue_push( &(_jobQueue), 0 );
404  }
405  if (_updatesystem) {
406  queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
407  queue_push( &(_jobQueue), 0 );
408  }
409  if (_distupgrade) {
410  queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
411  queue_push( &(_jobQueue), 0 );
412  }
413  if (_distupgrade_removeunsupported) {
414  queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
415  queue_push( &(_jobQueue), 0 );
416  }
417  solverSetFocus( *_satSolver, _focus );
418  solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
419  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
420  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
421  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
422  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange);
423  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
424  solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide);
425  solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
426  solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED, _onlyRequires);
427  solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade );
428  solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange );
429  solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange );
430  solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, _dup_allowvendorchange );
431 #if 1
432 #define HACKENV(X,D) solver_set_flag(_satSolver, X, env::HACKENV( #X, D ) );
433  HACKENV( SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade );
434  HACKENV( SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange );
435  HACKENV( SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange );
436  HACKENV( SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE,_dup_allowvendorchange );
437 #undef HACKENV
438 #endif
440 
441  // Solve !
442  MIL << "Starting solving...." << endl;
443  MIL << *this;
444  solver_solve( _satSolver, &(_jobQueue) );
445  MIL << "....Solver end" << endl;
446 
447  // copying solution back to zypp pool
448  //-----------------------------------------
449  _result_items_to_install.clear();
450  _result_items_to_remove.clear();
451 
452  /* solvables to be installed */
453  Queue decisionq;
454  queue_init(&decisionq);
455  solver_get_decisionqueue(_satSolver, &decisionq);
456  for ( int i = 0; i < decisionq.count; ++i )
457  {
458  sat::Solvable slv( decisionq.elements[i] );
459  if ( !slv || slv.isSystem() )
460  continue;
461 
462  PoolItem poolItem( slv );
464  _result_items_to_install.push_back( poolItem );
465  }
466  queue_free(&decisionq);
467 
468  /* solvables to be erased */
469  Repository systemRepo( sat::Pool::instance().findSystemRepo() ); // don't create if it does not exist
470  if ( systemRepo && ! systemRepo.solvablesEmpty() )
471  {
472  bool mustCheckObsoletes = false;
473  for_( it, systemRepo.solvablesBegin(), systemRepo.solvablesEnd() )
474  {
475  if (solver_get_decisionlevel(_satSolver, it->id()) > 0)
476  continue;
477 
478  // Check if this is an update
479  CheckIfUpdate info( *it );
480  PoolItem poolItem( *it );
481  invokeOnEach( _pool.byIdentBegin( poolItem ),
482  _pool.byIdentEnd( poolItem ),
483  resfilter::ByUninstalled(), // ByUninstalled
484  functor::functorRef<bool,PoolItem> (info) );
485 
486  if (info.is_updated) {
488  } else {
490  if ( ! mustCheckObsoletes )
491  mustCheckObsoletes = true; // lazy check for UninstalledDueToObsolete
492  }
493  _result_items_to_remove.push_back (poolItem);
494  }
495  if ( mustCheckObsoletes )
496  {
497  sat::WhatObsoletes obsoleted( _result_items_to_install.begin(), _result_items_to_install.end() );
498  for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
499  {
500  ResStatus & status( it->status() );
501  // WhatObsoletes contains installed items only!
502  if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
503  status.setToBeUninstalledDueToObsolete();
504  }
505  }
506  }
507 
508  Queue recommendations;
509  Queue suggestions;
510  Queue orphaned;
511  Queue unneeded;
512  queue_init(&recommendations);
513  queue_init(&suggestions);
514  queue_init(&orphaned);
515  queue_init(&unneeded);
516  solver_get_recommendations(_satSolver, &recommendations, &suggestions, 0);
517  solver_get_orphaned(_satSolver, &orphaned);
518  solver_get_unneeded(_satSolver, &unneeded, 1);
519  /* solvables which are recommended */
520  for ( int i = 0; i < recommendations.count; ++i )
521  {
522  PoolItem poolItem( getPoolItem( recommendations.elements[i] ) );
523  poolItem.status().setRecommended( true );
524  }
525 
526  /* solvables which are suggested */
527  for ( int i = 0; i < suggestions.count; ++i )
528  {
529  PoolItem poolItem( getPoolItem( suggestions.elements[i] ) );
530  poolItem.status().setSuggested( true );
531  }
532 
533  _problem_items.clear();
534  /* solvables which are orphaned */
535  for ( int i = 0; i < orphaned.count; ++i )
536  {
537  PoolItem poolItem( getPoolItem( orphaned.elements[i] ) );
538  poolItem.status().setOrphaned( true );
539  _problem_items.push_back( poolItem );
540  }
541 
542  /* solvables which are unneeded */
543  for ( int i = 0; i < unneeded.count; ++i )
544  {
545  PoolItem poolItem( getPoolItem( unneeded.elements[i] ) );
546  poolItem.status().setUnneeded( true );
547  }
548 
549  queue_free(&recommendations);
550  queue_free(&suggestions);
551  queue_free(&orphaned);
552  queue_free(&unneeded);
553 
554  /* Write validation state back to pool */
555  Queue flags, solvableQueue;
556 
557  queue_init(&flags);
558  queue_init(&solvableQueue);
559 
560  CollectPseudoInstalled collectPseudoInstalled(&solvableQueue);
561  invokeOnEach( _pool.begin(),
562  _pool.end(),
563  functor::functorRef<bool,PoolItem> (collectPseudoInstalled) );
564  solver_trivial_installable(_satSolver, &solvableQueue, &flags );
565  for (int i = 0; i < solvableQueue.count; i++) {
566  PoolItem item = _pool.find (sat::Solvable(solvableQueue.elements[i]));
567  item.status().setUndetermined();
568 
569  if (flags.elements[i] == -1) {
570  item.status().setNonRelevant();
571  XDEBUG("SATSolutionToPool(" << item << " ) nonRelevant !");
572  } else if (flags.elements[i] == 1) {
573  item.status().setSatisfied();
574  XDEBUG("SATSolutionToPool(" << item << " ) satisfied !");
575  } else if (flags.elements[i] == 0) {
576  item.status().setBroken();
577  XDEBUG("SATSolutionToPool(" << item << " ) broken !");
578  }
579  }
580  queue_free(&(solvableQueue));
581  queue_free(&flags);
582 
583 
584  // Solvables which were selected due requirements which have been made by the user will
585  // be selected by APPL_LOW. We can't use any higher level, because this setting must
586  // not serve as a request for the next solver run. APPL_LOW is reset before solving.
587  for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
588  sat::WhatProvides rpmProviders(*iter);
589  for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
590  PoolItem poolItem(*iter2);
591  if (poolItem.status().isToBeInstalled()) {
592  MIL << "User requirement " << *iter << " sets " << poolItem << endl;
593  poolItem.status().setTransactByValue (ResStatus::APPL_LOW);
594  }
595  }
596  }
597  for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
598  sat::WhatProvides rpmProviders(*iter);
599  for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
600  PoolItem poolItem(*iter2);
601  if (poolItem.status().isToBeUninstalled()) {
602  MIL << "User conflict " << *iter << " sets " << poolItem << endl;
603  poolItem.status().setTransactByValue (ResStatus::APPL_LOW);
604  }
605  }
606  }
607 
608  if (solver_problem_count(_satSolver) > 0 )
609  {
610  ERR << "Solverrun finished with an ERROR" << endl;
611  return false;
612  }
613 
614  return true;
615 }
616 
617 
618 void
619 SATResolver::solverInit(const PoolItemList & weakItems)
620 {
621 
622  MIL << "SATResolver::solverInit()" << endl;
623 
624  // remove old stuff
625  solverEnd();
626  queue_init( &_jobQueue );
627 
628  // clear and rebuild: _items_to_install, _items_to_remove, _items_to_lock, _items_to_keep
629  {
630  SATCollectTransact collector( _items_to_install, _items_to_remove, _items_to_lock, _items_to_keep, solveSrcPackages() );
631  invokeOnEach ( _pool.begin(), _pool.end(), functor::functorRef<bool,PoolItem>( collector ) );
632  }
633 
634  for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
635  Id id = (*iter)->satSolvable().id();
636  if (id == ID_NULL) {
637  ERR << "Weaken: " << *iter << " not found" << endl;
638  }
639  MIL << "Weaken dependencies of " << *iter << endl;
640  queue_push( &(_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
641  queue_push( &(_jobQueue), id );
642  }
643 
644  // Ad rules for retracted patches and packages
645  {
646  queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
647  queue_push( &(_jobQueue), sat::Solvable::retractedToken.id() );
648  queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
649  queue_push( &(_jobQueue), sat::Solvable::ptfMasterToken.id() );
650  // bsc#1186503: ptfPackageToken should not be blacklisted
651  }
652 
653  // Ad rules for changed requestedLocales
654  const auto & trackedLocaleIds( myPool().trackedLocaleIds() );
655  for ( const auto & locale : trackedLocaleIds.added() )
656  {
657  queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
658  queue_push( &(_jobQueue), Capability( ResolverNamespace::language, IdString(locale) ).id() );
659  }
660 
661  for ( const auto & locale : trackedLocaleIds.removed() )
662  {
663  queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES | SOLVER_CLEANDEPS ); // needs uncond. SOLVER_CLEANDEPS!
664  queue_push( &(_jobQueue), Capability( ResolverNamespace::language, IdString(locale) ).id() );
665  }
666 
667  // Add rules for parallel installable resolvables with different versions
668  for ( const sat::Solvable & solv : myPool().multiversionList() )
669  {
670  queue_push( &(_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
671  queue_push( &(_jobQueue), solv.id() );
672  }
673 
674  ::pool_add_userinstalled_jobs(_satPool, sat::Pool::instance().autoInstalled(), &(_jobQueue), GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED);
675 
676  if ( _distupgrade )
677  {
678  if ( ZConfig::instance().solverUpgradeRemoveDroppedPackages() )
679  {
680  MIL << "Checking droplists ..." << endl;
681  // Dropped packages: look for 'weakremover()' provides
682  // in dup candidates of installed products.
683  ResPoolProxy proxy( ResPool::instance().proxy() );
684  for_( it, proxy.byKindBegin<Product>(), proxy.byKindEnd<Product>() )
685  {
686  if ( (*it)->onSystem() ) // (to install) or (not to delete)
687  {
688  Product::constPtr prodCand( (*it)->candidateAsKind<Product>() );
689  if ( ! prodCand )
690  continue; // product no longer available
691 
692  CapabilitySet droplist( prodCand->droplist() );
693  dumpRangeLine( MIL << "Droplist for " << (*it)->candidateObj() << ": " << droplist.size() << " ", droplist.begin(), droplist.end() ) << endl;
694  for_( cap, droplist.begin(), droplist.end() )
695  {
696  queue_push( &_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
697  queue_push( &_jobQueue, cap->id() );
698  }
699  }
700  }
701  }
702  else
703  {
704  MIL << "Droplist processing is disabled." << endl;
705  }
706  }
707 }
708 
709 void
710 SATResolver::solverEnd()
711 {
712  // cleanup
713  if ( _satSolver )
714  {
715  solver_free(_satSolver);
716  _satSolver = NULL;
717  queue_free( &(_jobQueue) );
718  }
719 }
720 
721 
722 bool
723 SATResolver::resolvePool(const CapabilitySet & requires_caps,
724  const CapabilitySet & conflict_caps,
725  const PoolItemList & weakItems,
726  const std::set<Repository> & upgradeRepos)
727 {
728  MIL << "SATResolver::resolvePool()" << endl;
729 
730  // initialize
731  solverInit(weakItems);
732 
733  for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
734  Id id = (*iter)->satSolvable().id();
735  if (id == ID_NULL) {
736  ERR << "Install: " << *iter << " not found" << endl;
737  } else {
738  MIL << "Install " << *iter << endl;
739  queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
740  queue_push( &(_jobQueue), id );
741  }
742  }
743 
744  for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
745  Id id = (*iter)->satSolvable().id();
746  if (id == ID_NULL) {
747  ERR << "Delete: " << *iter << " not found" << endl;
748  } else {
749  MIL << "Delete " << *iter << endl;
750  queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE | MAYBE_CLEANDEPS );
751  queue_push( &(_jobQueue), id);
752  }
753  }
754 
755  for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
756  {
757  queue_push( &(_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
758  queue_push( &(_jobQueue), iter->get()->repoid );
759  MIL << "Upgrade repo " << *iter << endl;
760  }
761 
762  for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
763  queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
764  queue_push( &(_jobQueue), iter->id() );
765  MIL << "Requires " << *iter << endl;
766  }
767 
768  for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
769  queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES | MAYBE_CLEANDEPS );
770  queue_push( &(_jobQueue), iter->id() );
771  MIL << "Conflicts " << *iter << endl;
772  }
773 
774  // set requirements for a running system
775  setSystemRequirements();
776 
777  // set locks for the solver
778  setLocks();
779 
780  // solving
781  bool ret = solving(requires_caps, conflict_caps);
782 
783  (ret?MIL:WAR) << "SATResolver::resolvePool() done. Ret:" << ret << endl;
784  return ret;
785 }
786 
787 
788 bool
789 SATResolver::resolveQueue(const SolverQueueItemList &requestQueue,
790  const PoolItemList & weakItems)
791 {
792  MIL << "SATResolver::resolvQueue()" << endl;
793 
794  // initialize
795  solverInit(weakItems);
796 
797  // generate solver queue
798  for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
799  (*iter)->addRule(_jobQueue);
800  }
801 
802  // Add addition item status to the resolve-queue cause these can be set by problem resolutions
803  for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
804  Id id = (*iter)->satSolvable().id();
805  if (id == ID_NULL) {
806  ERR << "Install: " << *iter << " not found" << endl;
807  } else {
808  MIL << "Install " << *iter << endl;
809  queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
810  queue_push( &(_jobQueue), id );
811  }
812  }
813  for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
814  sat::detail::IdType ident( (*iter)->satSolvable().ident().id() );
815  MIL << "Delete " << *iter << ident << endl;
816  queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | MAYBE_CLEANDEPS );
817  queue_push( &(_jobQueue), ident);
818  }
819 
820  // set requirements for a running system
821  setSystemRequirements();
822 
823  // set locks for the solver
824  setLocks();
825 
826  // solving
827  bool ret = solving();
828 
829  MIL << "SATResolver::resolveQueue() done. Ret:" << ret << endl;
830  return ret;
831 }
832 
834 void SATResolver::doUpdate()
835 {
836  MIL << "SATResolver::doUpdate()" << endl;
837 
838  // initialize
839  solverInit(PoolItemList());
840 
841  // set requirements for a running system
842  setSystemRequirements();
843 
844  // set locks for the solver
845  setLocks();
846 
847  _satSolver = solver_create( _satPool );
848  ::pool_set_custom_vendorcheck( _satPool, &vendorCheck );
849  if (_fixsystem) {
850  queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
851  queue_push( &(_jobQueue), 0 );
852  }
853  if (1) {
854  queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
855  queue_push( &(_jobQueue), 0 );
856  }
857  if (_distupgrade) {
858  queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
859  queue_push( &(_jobQueue), 0 );
860  }
861  if (_distupgrade_removeunsupported) {
862  queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
863  queue_push( &(_jobQueue), 0 );
864  }
865  solverSetFocus( *_satSolver, _focus );
866  solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
867  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
868  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
869  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
870  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange);
871  solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
872  solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide);
873  solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
874  solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED, _onlyRequires);
875 
877 
878  // Solve !
879  MIL << "Starting solving for update...." << endl;
880  MIL << *this;
881  solver_solve( _satSolver, &(_jobQueue) );
882  MIL << "....Solver end" << endl;
883 
884  // copying solution back to zypp pool
885  //-----------------------------------------
886 
887  /* solvables to be installed */
888  Queue decisionq;
889  queue_init(&decisionq);
890  solver_get_decisionqueue(_satSolver, &decisionq);
891  for (int i = 0; i < decisionq.count; i++)
892  {
893  Id p;
894  p = decisionq.elements[i];
895  if (p < 0 || !sat::Solvable(p))
896  continue;
897  if (sat::Solvable(p).repository().get() == _satSolver->pool->installed)
898  continue;
899 
900  PoolItem poolItem = _pool.find (sat::Solvable(p));
901  if (poolItem) {
903  } else {
904  ERR << "id " << p << " not found in ZYPP pool." << endl;
905  }
906  }
907  queue_free(&decisionq);
908 
909  /* solvables to be erased */
910  for (int i = _satSolver->pool->installed->start; i < _satSolver->pool->installed->start + _satSolver->pool->installed->nsolvables; i++)
911  {
912  if (solver_get_decisionlevel(_satSolver, i) > 0)
913  continue;
914 
915  PoolItem poolItem( _pool.find( sat::Solvable(i) ) );
916  if (poolItem) {
917  // Check if this is an update
918  CheckIfUpdate info( (sat::Solvable(i)) );
919  invokeOnEach( _pool.byIdentBegin( poolItem ),
920  _pool.byIdentEnd( poolItem ),
921  resfilter::ByUninstalled(), // ByUninstalled
922  functor::functorRef<bool,PoolItem> (info) );
923 
924  if (info.is_updated) {
926  } else {
928  }
929  } else {
930  ERR << "id " << i << " not found in ZYPP pool." << endl;
931  }
932  }
933  MIL << "SATResolver::doUpdate() done" << endl;
934 }
935 
936 
937 
938 //----------------------------------------------------------------------------
939 //----------------------------------------------------------------------------
940 // error handling
941 //----------------------------------------------------------------------------
942 //----------------------------------------------------------------------------
943 
944 //----------------------------------------------------------------------------
945 // helper function
946 //----------------------------------------------------------------------------
947 
949 {
950  ProblemSolutionCombi *problemSolution;
951  TransactionKind action;
952  FindPackage (ProblemSolutionCombi *p, const TransactionKind act)
953  : problemSolution (p)
954  , action (act)
955  {
956  }
957 
959  {
960  problemSolution->addSingleAction (p, action);
961  return true;
962  }
963 };
964 
965 
966 //----------------------------------------------------------------------------
967 // Checking if this solvable/item has a buddy which reflect the real
968 // user visible description of an item
969 // e.g. The release package has a buddy to the concerning product item.
970 // This user want's the message "Product foo conflicts with product bar" and
971 // NOT "package release-foo conflicts with package release-bar"
972 // (ma: that's why we should map just packages to buddies, not vice versa)
973 //----------------------------------------------------------------------------
974 inline sat::Solvable mapBuddy( const PoolItem & item_r )
975 {
976  if ( item_r.satSolvable().isKind<Package>() )
977  {
978  sat::Solvable buddy = item_r.buddy();
979  if ( buddy )
980  return buddy;
981  }
982  return item_r.satSolvable();
983 }
985 { return mapBuddy( PoolItem( item_r ) ); }
986 
987 PoolItem SATResolver::mapItem ( const PoolItem & item )
988 { return PoolItem( mapBuddy( item ) ); }
989 
990 sat::Solvable SATResolver::mapSolvable ( const Id & id )
991 { return mapBuddy( sat::Solvable(id) ); }
992 
993 string SATResolver::SATprobleminfoString(Id problem, string &detail, Id &ignoreId)
994 {
995  string ret;
996  sat::detail::CPool *pool = _satSolver->pool;
997  Id probr;
998  Id dep, source, target;
999  sat::Solvable s, s2;
1000 
1001  ignoreId = 0;
1002 
1003  // FIXME: solver_findallproblemrules to get all rules for this problem
1004  // (the 'most relevabt' one returned by solver_findproblemrule is embedded
1005  probr = solver_findproblemrule(_satSolver, problem);
1006  switch (solver_ruleinfo(_satSolver, probr, &source, &target, &dep))
1007  {
1008  case SOLVER_RULE_DISTUPGRADE:
1009  s = mapSolvable (source);
1010  ret = str::form (_("%s does not belong to a distupgrade repository"), s.asString().c_str());
1011  break;
1012  case SOLVER_RULE_INFARCH:
1013  s = mapSolvable (source);
1014  ret = str::form (_("%s has inferior architecture"), s.asString().c_str());
1015  break;
1016  case SOLVER_RULE_UPDATE:
1017  s = mapSolvable (source);
1018  ret = str::form (_("problem with installed package %s"), s.asString().c_str());
1019  break;
1020  case SOLVER_RULE_JOB:
1021  ret = _("conflicting requests");
1022  break;
1023  case SOLVER_RULE_RPM:
1024  ret = _("some dependency problem");
1025  break;
1026  case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1027  ret = str::form (_("nothing provides requested %s"), pool_dep2str(pool, dep));
1028  detail += _("Have you enabled all requested repositories?");
1029  break;
1030  case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1031  ret = str::form (_("package %s does not exist"), pool_dep2str(pool, dep));
1032  detail += _("Have you enabled all requested repositories?");
1033  break;
1034  case SOLVER_RULE_JOB_UNSUPPORTED:
1035  ret = _("unsupported request");
1036  break;
1037  case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1038  ret = str::form (_("%s is provided by the system and cannot be erased"), pool_dep2str(pool, dep));
1039  break;
1040  case SOLVER_RULE_RPM_NOT_INSTALLABLE:
1041  s = mapSolvable (source);
1042  ret = str::form (_("%s is not installable"), s.asString().c_str());
1043  break;
1044  case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
1045  ignoreId = source; // for setting weak dependencies
1046  s = mapSolvable (source);
1047  ret = str::form (_("nothing provides %s needed by %s"), pool_dep2str(pool, dep), s.asString().c_str());
1048  break;
1049  case SOLVER_RULE_RPM_SAME_NAME:
1050  s = mapSolvable (source);
1051  s2 = mapSolvable (target);
1052  ret = str::form (_("cannot install both %s and %s"), s.asString().c_str(), s2.asString().c_str());
1053  break;
1054  case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
1055  s = mapSolvable (source);
1056  s2 = mapSolvable (target);
1057  ret = str::form (_("%s conflicts with %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
1058  break;
1059  case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
1060  s = mapSolvable (source);
1061  s2 = mapSolvable (target);
1062  ret = str::form (_("%s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
1063  break;
1064  case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
1065  s = mapSolvable (source);
1066  s2 = mapSolvable (target);
1067  ret = str::form (_("installed %s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
1068  break;
1069  case SOLVER_RULE_RPM_SELF_CONFLICT:
1070  s = mapSolvable (source);
1071  ret = str::form (_("solvable %s conflicts with %s provided by itself"), s.asString().c_str(), pool_dep2str(pool, dep));
1072  break;
1073  case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
1074  ignoreId = source; // for setting weak dependencies
1075  s = mapSolvable (source);
1076  Capability cap(dep);
1077  sat::WhatProvides possibleProviders(cap);
1078 
1079  // check, if a provider will be deleted
1080  typedef list<PoolItem> ProviderList;
1081  ProviderList providerlistInstalled, providerlistUninstalled;
1082  for_( iter1, possibleProviders.begin(), possibleProviders.end() ) {
1083  PoolItem provider1 = ResPool::instance().find( *iter1 );
1084  // find pair of an installed/uninstalled item with the same NVR
1085  bool found = false;
1086  for_( iter2, possibleProviders.begin(), possibleProviders.end() ) {
1087  PoolItem provider2 = ResPool::instance().find( *iter2 );
1088  if (compareByNVR (provider1,provider2) == 0
1089  && ( (provider1.status().isInstalled() && provider2.status().isUninstalled())
1090  || (provider2.status().isInstalled() && provider1.status().isUninstalled()) )) {
1091  found = true;
1092  break;
1093  }
1094  }
1095  if (!found) {
1096  if (provider1.status().isInstalled())
1097  providerlistInstalled.push_back(provider1);
1098  else
1099  providerlistUninstalled.push_back(provider1);
1100  }
1101  }
1102 
1103  ret = str::form (_("%s requires %s, but this requirement cannot be provided"), s.asString().c_str(), pool_dep2str(pool, dep));
1104  if (providerlistInstalled.size() > 0) {
1105  detail += _("deleted providers: ");
1106  for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1107  if (iter == providerlistInstalled.begin())
1108  detail += itemToString( *iter );
1109  else
1110  detail += "\n " + itemToString( mapItem(*iter) );
1111  }
1112  }
1113  if (providerlistUninstalled.size() > 0) {
1114  if (detail.size() > 0)
1115  // translators: 'uninstallable' == 'not installable'
1116  detail += _("\nuninstallable providers: ");
1117  else
1118  // translators: 'uninstallable' == 'not installable'
1119  detail = _("uninstallable providers: ");
1120  for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1121  if (iter == providerlistUninstalled.begin())
1122  detail += itemToString( *iter );
1123  else
1124  detail += "\n " + itemToString( mapItem(*iter) );
1125  }
1126  }
1127  break;
1128  }
1129 
1130  return ret;
1131 }
1132 
1134 namespace {
1136  struct PtfPatchHint
1137  {
1138  void notInstallPatch( sat::Solvable slv_r, unsigned solution_r )
1139  { _patch.push_back( slv_r.ident() ); }
1140 
1141  void removePtf( sat::Solvable slv_r, unsigned solution_r )
1142  { _ptf.push_back( slv_r.ident() ); }
1143 
1144  bool applies() const
1145  { return not _ptf.empty(); }
1146 
1147  std::string description() const {
1148  if ( not _patch.empty() ) {
1149  return str::Str()
1150  // translator: %1% is the name of a PTF, %2% the name of a patch.
1151  << (str::Format( _("%1% is not yet fully integrated into %2%.") ) % printlist(_ptf) % printlist(_patch)) << endl
1152  << _("Typically you want to keep the PTF and choose to not install the maintenance patches.");
1153  }
1154  //else: a common problem due to an installed ptf
1155  return str::Str()
1156  // translator: %1% is the name of a PTF.
1157  << (str::Format( _("The installed %1% blocks the desired action.") ) % printlist(_ptf)) << endl
1158  << _("Typically you want to keep the PTF and choose to cancel the action.");
1159  }
1160  private:
1161  using StoreType = IdString;
1162  static std::string printlist( const std::vector<StoreType> & list_r )
1163  { str::Str ret; dumpRange( ret.stream(), list_r.begin(), list_r.end(), "", "", ", ", "", "" ); return ret; }
1164 
1165  std::vector<StoreType> _ptf;
1166  std::vector<StoreType> _patch;
1167  };
1168 }
1170 
1172 SATResolver::problems ()
1173 {
1174  ResolverProblemList resolverProblems;
1175  if (_satSolver && solver_problem_count(_satSolver)) {
1176  sat::detail::CPool *pool = _satSolver->pool;
1177  int pcnt;
1178  Id p, rp, what;
1179  Id problem, solution, element;
1180  sat::Solvable s, sd;
1181 
1182  CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1183  CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1184 
1185  MIL << "Encountered problems! Here are the solutions:\n" << endl;
1186  pcnt = 1;
1187  problem = 0;
1188  while ((problem = solver_next_problem(_satSolver, problem)) != 0) {
1189  MIL << "Problem " << pcnt++ << ":" << endl;
1190  MIL << "====================================" << endl;
1191  string detail;
1192  Id ignoreId;
1193  string whatString = SATprobleminfoString (problem,detail,ignoreId);
1194  MIL << whatString << endl;
1195  MIL << "------------------------------------" << endl;
1196  ResolverProblem_Ptr resolverProblem = new ResolverProblem (whatString, detail);
1197 
1198  PtfPatchHint ptfPatchHint; // bsc#1194848 hint on ptf<>patch conflicts
1199  solution = 0;
1200  while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
1201  element = 0;
1202  ProblemSolutionCombi *problemSolution = new ProblemSolutionCombi;
1203  while ((element = solver_next_solutionelement(_satSolver, problem, solution, element, &p, &rp)) != 0) {
1204  if (p == SOLVER_SOLUTION_JOB) {
1205  /* job, rp is index into job queue */
1206  what = _jobQueue.elements[rp];
1207  switch (_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1208  {
1209  case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1210  s = mapSolvable (what);
1211  PoolItem poolItem = _pool.find (s);
1212  if (poolItem) {
1213  if (pool->installed && s.get()->repo == pool->installed) {
1214  problemSolution->addSingleAction (poolItem, REMOVE);
1215  string description = str::form (_("remove lock to allow removal of %s"), s.asString().c_str() );
1216  MIL << description << endl;
1217  problemSolution->addDescription (description);
1218  } else {
1219  problemSolution->addSingleAction (poolItem, KEEP);
1220  string description = str::form (_("do not install %s"), s.asString().c_str());
1221  MIL << description << endl;
1222  problemSolution->addDescription (description);
1223  if ( s.isKind<Patch>() )
1224  ptfPatchHint.notInstallPatch( s, resolverProblem->solutions().size() );
1225  }
1226  } else {
1227  ERR << "SOLVER_INSTALL_SOLVABLE: No item found for " << s.asString() << endl;
1228  }
1229  }
1230  break;
1231  case SOLVER_ERASE | SOLVER_SOLVABLE: {
1232  s = mapSolvable (what);
1233  PoolItem poolItem = _pool.find (s);
1234  if (poolItem) {
1235  if (pool->installed && s.get()->repo == pool->installed) {
1236  problemSolution->addSingleAction (poolItem, KEEP);
1237  string description = str::form (_("keep %s"), s.asString().c_str());
1238  MIL << description << endl;
1239  problemSolution->addDescription (description);
1240  } else {
1241  problemSolution->addSingleAction (poolItem, UNLOCK);
1242  string description = str::form (_("remove lock to allow installation of %s"), itemToString( poolItem ).c_str());
1243  MIL << description << endl;
1244  problemSolution->addDescription (description);
1245  }
1246  } else {
1247  ERR << "SOLVER_ERASE_SOLVABLE: No item found for " << s.asString() << endl;
1248  }
1249  }
1250  break;
1251  case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1252  {
1253  IdString ident( what );
1254  SolverQueueItemInstall_Ptr install =
1255  new SolverQueueItemInstall(_pool, ident.asString(), false );
1256  problemSolution->addSingleAction (install, REMOVE_SOLVE_QUEUE_ITEM);
1257 
1258  string description = str::form (_("do not install %s"), ident.c_str() );
1259  MIL << description << endl;
1260  problemSolution->addDescription (description);
1261  }
1262  break;
1263  case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1264  {
1265  // As we do not know, if this request has come from resolvePool or
1266  // resolveQueue we will have to take care for both cases.
1267  IdString ident( what );
1268  FindPackage info (problemSolution, KEEP);
1269  invokeOnEach( _pool.byIdentBegin( ident ),
1270  _pool.byIdentEnd( ident ),
1271  functor::chain (resfilter::ByInstalled (), // ByInstalled
1272  resfilter::ByTransact ()), // will be deinstalled
1273  functor::functorRef<bool,PoolItem> (info) );
1274 
1275  SolverQueueItemDelete_Ptr del =
1276  new SolverQueueItemDelete(_pool, ident.asString(), false );
1277  problemSolution->addSingleAction (del, REMOVE_SOLVE_QUEUE_ITEM);
1278 
1279  string description = str::form (_("keep %s"), ident.c_str());
1280  MIL << description << endl;
1281  problemSolution->addDescription (description);
1282  }
1283  break;
1284  case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1285  {
1286  problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_REQUIRE);
1287  string description = "";
1288 
1289  // Checking if this problem solution would break your system
1290  if (system_requires.find(Capability(what)) != system_requires.end()) {
1291  // Show a better warning
1292  resolverProblem->setDetails( resolverProblem->description() + "\n" + resolverProblem->details() );
1293  resolverProblem->setDescription(_("This request will break your system!"));
1294  description = _("ignore the warning of a broken system");
1295  description += string(" (requires:")+pool_dep2str(pool, what)+")";
1296  MIL << description << endl;
1297  problemSolution->addFrontDescription (description);
1298  } else {
1299  description = str::form (_("do not ask to install a solvable providing %s"), pool_dep2str(pool, what));
1300  MIL << description << endl;
1301  problemSolution->addDescription (description);
1302  }
1303  }
1304  break;
1305  case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1306  {
1307  problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_CONFLICT);
1308  string description = "";
1309 
1310  // Checking if this problem solution would break your system
1311  if (system_conflicts.find(Capability(what)) != system_conflicts.end()) {
1312  // Show a better warning
1313  resolverProblem->setDetails( resolverProblem->description() + "\n" + resolverProblem->details() );
1314  resolverProblem->setDescription(_("This request will break your system!"));
1315  description = _("ignore the warning of a broken system");
1316  description += string(" (conflicts:")+pool_dep2str(pool, what)+")";
1317  MIL << description << endl;
1318  problemSolution->addFrontDescription (description);
1319 
1320  } else {
1321  description = str::form (_("do not ask to delete all solvables providing %s"), pool_dep2str(pool, what));
1322  MIL << description << endl;
1323  problemSolution->addDescription (description);
1324  }
1325  }
1326  break;
1327  case SOLVER_UPDATE | SOLVER_SOLVABLE:
1328  {
1329  s = mapSolvable (what);
1330  PoolItem poolItem = _pool.find (s);
1331  if (poolItem) {
1332  if (pool->installed && s.get()->repo == pool->installed) {
1333  problemSolution->addSingleAction (poolItem, KEEP);
1334  string description = str::form (_("do not install most recent version of %s"), s.asString().c_str());
1335  MIL << description << endl;
1336  problemSolution->addDescription (description);
1337  } else {
1338  ERR << "SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem << " is not selected for installation" << endl;
1339  }
1340  } else {
1341  ERR << "SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.asString() << endl;
1342  }
1343  }
1344  break;
1345  default:
1346  MIL << "- do something different" << endl;
1347  ERR << "No valid solution available" << endl;
1348  break;
1349  }
1350  } else if (p == SOLVER_SOLUTION_INFARCH) {
1351  s = mapSolvable (rp);
1352  PoolItem poolItem = _pool.find (s);
1353  if (pool->installed && s.get()->repo == pool->installed) {
1354  problemSolution->addSingleAction (poolItem, LOCK);
1355  string description = str::form (_("keep %s despite the inferior architecture"), s.asString().c_str());
1356  MIL << description << endl;
1357  problemSolution->addDescription (description);
1358  } else {
1359  problemSolution->addSingleAction (poolItem, INSTALL);
1360  string description = str::form (_("install %s despite the inferior architecture"), s.asString().c_str());
1361  MIL << description << endl;
1362  problemSolution->addDescription (description);
1363  }
1364  } else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1365  s = mapSolvable (rp);
1366  PoolItem poolItem = _pool.find (s);
1367  if (pool->installed && s.get()->repo == pool->installed) {
1368  problemSolution->addSingleAction (poolItem, LOCK);
1369  string description = str::form (_("keep obsolete %s"), s.asString().c_str());
1370  MIL << description << endl;
1371  problemSolution->addDescription (description);
1372  } else {
1373  problemSolution->addSingleAction (poolItem, INSTALL);
1374  string description = str::form (_("install %s from excluded repository"), s.asString().c_str());
1375  MIL << description << endl;
1376  problemSolution->addDescription (description);
1377  }
1378  } else if ( p == SOLVER_SOLUTION_BLACK ) {
1379  // Allow to install a blacklisted package (PTF, retracted,...).
1380  // For not-installed items only
1381  s = mapSolvable (rp);
1382  PoolItem poolItem = _pool.find (s);
1383 
1384  problemSolution->addSingleAction (poolItem, INSTALL);
1385  std::string description;
1386  if ( s.isRetracted() ) {
1387  // translator: %1% is a package name
1388  description = str::Format(_("install %1% although it has been retracted")) % s.asString();
1389  } else if ( s.isPtf() ) {
1390  // translator: %1% is a package name
1391  description = str::Format(_("allow to install the PTF %1%")) % s.asString();
1392  } else {
1393  // translator: %1% is a package name
1394  description = str::Format(_("install %1% although it is blacklisted")) % s.asString();
1395  }
1396  MIL << description << endl;
1397  problemSolution->addDescription( description );
1398  } else if ( p > 0 ) {
1399  /* policy, replace p with rp */
1400  s = mapSolvable (p);
1401  PoolItem itemFrom = _pool.find (s);
1402  if (rp)
1403  {
1404  int gotone = 0;
1405 
1406  sd = mapSolvable (rp);
1407  PoolItem itemTo = _pool.find (sd);
1408  if (itemFrom && itemTo) {
1409  problemSolution->addSingleAction (itemTo, INSTALL);
1410  int illegal = policy_is_illegal(_satSolver, s.get(), sd.get(), 0);
1411 
1412  if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1413  {
1414  string description = str::form (_("downgrade of %s to %s"), s.asString().c_str(), sd.asString().c_str());
1415  MIL << description << endl;
1416  problemSolution->addDescription (description);
1417  gotone = 1;
1418  }
1419  if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1420  {
1421  string description = str::form (_("architecture change of %s to %s"), s.asString().c_str(), sd.asString().c_str());
1422  MIL << description << endl;
1423  problemSolution->addDescription (description);
1424  gotone = 1;
1425  }
1426  if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1427  {
1428  IdString s_vendor( s.vendor() );
1429  IdString sd_vendor( sd.vendor() );
1430  std::string description;
1431  if ( s == sd )
1432  description = str::Format(_("install %s (with vendor change)\n %s --> %s") )
1433  % sd.asString().c_str()
1434  % ( s_vendor ? s_vendor.c_str() : " (no vendor) " )
1435  % ( sd_vendor ? sd_vendor.c_str() : " (no vendor) " );
1436  else
1437  description = str::Format(_("install %1% from vendor %2%\n replacing %3% from vendor %4%") )
1438  % sd.asString() % ( sd_vendor ? sd_vendor.c_str() : " (no vendor) " )
1439  % s.asString() % ( s_vendor ? s_vendor.c_str() : " (no vendor) " );
1440 
1441  MIL << description << endl;
1442  problemSolution->addDescription (description);
1443  gotone = 1;
1444  }
1445  if (!gotone) {
1446  string description = str::form (_("replacement of %s with %s"), s.asString().c_str(), sd.asString().c_str());
1447  MIL << description << endl;
1448  problemSolution->addDescription (description);
1449  }
1450  } else {
1451  ERR << s.asString() << " or " << sd.asString() << " not found" << endl;
1452  }
1453  }
1454  else
1455  {
1456  if (itemFrom) {
1457  string description = str::form (_("deinstallation of %s"), s.asString().c_str());
1458  MIL << description << endl;
1459  problemSolution->addDescription (description);
1460  problemSolution->addSingleAction (itemFrom, REMOVE);
1461  if ( s.isPtfMaster() )
1462  ptfPatchHint.removePtf( s, resolverProblem->solutions().size() );
1463  }
1464  }
1465  }
1466  else
1467  {
1468  INT << "Unknown solution " << p << endl;
1469  }
1470 
1471  }
1472  resolverProblem->addSolution (problemSolution,
1473  problemSolution->actionCount() > 1 ? true : false); // Solutions with more than 1 action will be shown first.
1474  MIL << "------------------------------------" << endl;
1475  }
1476 
1477  if (ignoreId > 0) {
1478  // There is a possibility to ignore this error by setting weak dependencies
1479  PoolItem item = _pool.find (sat::Solvable(ignoreId));
1480  ProblemSolutionIgnore *problemSolution = new ProblemSolutionIgnore(item);
1481  resolverProblem->addSolution (problemSolution,
1482  false); // Solutions will be shown at the end
1483  MIL << "ignore some dependencies of " << item << endl;
1484  MIL << "------------------------------------" << endl;
1485  }
1486 
1487  // bsc#1194848 hint on ptf<>patch conflicts
1488  if ( ptfPatchHint.applies() ) {
1489  resolverProblem->setDescription( str::Str() << ptfPatchHint.description() << endl << "(" << resolverProblem->description() << ")" );
1490  }
1491  // save problem
1492  resolverProblems.push_back (resolverProblem);
1493  }
1494  }
1495  return resolverProblems;
1496 }
1497 
1498 void SATResolver::applySolutions( const ProblemSolutionList & solutions )
1499 { Resolver( _pool ).applySolutions( solutions ); }
1500 
1501 void SATResolver::setLocks()
1502 {
1503  for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter != _items_to_lock.end(); ++iter) {
1504  sat::detail::SolvableIdType ident( (*iter)->satSolvable().id() );
1505  if (iter->status().isInstalled()) {
1506  MIL << "Lock installed item " << *iter << endl;
1507  queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
1508  queue_push( &(_jobQueue), ident );
1509  } else {
1510  MIL << "Lock NOT installed item " << *iter << endl;
1511  queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE | MAYBE_CLEANDEPS );
1512  queue_push( &(_jobQueue), ident );
1513  }
1514  }
1515 
1517  // Weak locks: Ignore if an item with this name is already installed.
1518  // If it's not installed try to keep it this way using a weak delete
1520  std::set<IdString> unifiedByName;
1521  for (PoolItemList::const_iterator iter = _items_to_keep.begin(); iter != _items_to_keep.end(); ++iter) {
1522  IdString ident( (*iter)->satSolvable().ident() );
1523  if ( unifiedByName.insert( ident ).second )
1524  {
1525  if ( ! ui::Selectable::get( *iter )->hasInstalledObj() )
1526  {
1527  MIL << "Keep NOT installed name " << ident << " (" << *iter << ")" << endl;
1528  queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | SOLVER_WEAK | MAYBE_CLEANDEPS );
1529  queue_push( &(_jobQueue), ident.id() );
1530  }
1531  }
1532  }
1533 }
1534 
1535 void SATResolver::setSystemRequirements()
1536 {
1537  CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1538  CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1539 
1540  for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
1541  queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
1542  queue_push( &(_jobQueue), iter->id() );
1543  MIL << "SYSTEM Requires " << *iter << endl;
1544  }
1545 
1546  for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
1547  queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES | MAYBE_CLEANDEPS );
1548  queue_push( &(_jobQueue), iter->id() );
1549  MIL << "SYSTEM Conflicts " << *iter << endl;
1550  }
1551 
1552  // Lock the architecture of the running systems rpm
1553  // package on distupgrade.
1554  if ( _distupgrade && ZConfig::instance().systemRoot() == "/" )
1555  {
1556  ResPool pool( ResPool::instance() );
1557  IdString rpm( "rpm" );
1558  for_( it, pool.byIdentBegin(rpm), pool.byIdentEnd(rpm) )
1559  {
1560  if ( (*it)->isSystem() )
1561  {
1562  Capability archrule( (*it)->arch(), rpm.c_str(), Capability::PARSED );
1563  queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
1564  queue_push( &(_jobQueue), archrule.id() );
1565 
1566  }
1567  }
1568  }
1569 }
1570 
1571 sat::StringQueue SATResolver::autoInstalled() const
1572 {
1573  sat::StringQueue ret;
1574  if ( _satSolver )
1575  ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
1576  return ret;
1577 }
1578 
1579 sat::StringQueue SATResolver::userInstalled() const
1580 {
1581  sat::StringQueue ret;
1582  if ( _satSolver )
1583  ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES );
1584  return ret;
1585 }
1586 
1587 
1589 };// namespace detail
1592  };// namespace solver
1595 };// namespace zypp
1597 
Repository repository() const
The Repository this Solvable belongs to.
Definition: Solvable.cc:363
Interface to gettext.
std::list< ProblemSolution_Ptr > ProblemSolutionList
Definition: ProblemTypes.h:43
#define MIL
Definition: Logger.h:64
int IdType
Generic Id type.
Definition: PoolMember.h:130
static const IdString ptfMasterToken
Indicator provides ptf()
Definition: Solvable.h:59
A Solvable object within the sat Pool.
Definition: Solvable.h:53
Focus on updating requested packages and their dependencies as much as possible.
std::string alias() const
Short unique string to identify a repo.
Definition: Repository.cc:59
bool isToBeUninstalledDueToUpgrade() const
Definition: ResStatus.h:309
static ZConfig & instance()
Singleton ctor.
Definition: Resolver.cc:122
bool isToBeUninstalled() const
Definition: ResStatus.h:252
ProblemSolutionCombi * problemSolution
Definition: SATResolver.cc:950
ResolverFocus
The resolvers general attitude.
Definition: ResolverFocus.h:21
#define INT
Definition: Logger.h:68
static const ResStatus toBeInstalled
Definition: ResStatus.h:653
::_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Definition: PoolMember.h:86
std::ostream & dumpOn(std::ostream &str, const zypp::shared_ptr< void > &obj)
Definition: PtrTypes.h:151
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
Definition: PoolMember.h:151
#define OUTS(X)
Access to the sat-pools string space.
Definition: IdString.h:41
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Definition: Easy.h:27
bool sameNVRA(const SolvableType< Derived > &lhs, const Solvable &rhs)
Definition: SolvableType.h:233
Request the standard behavior (as defined in zypp.conf or 'Job')
bool resetTransact(TransactByValue causer_r)
Not the same as setTransact( false ).
Definition: ResStatus.h:476
TraitsType::constPtrType constPtr
Definition: Product.h:38
std::list< SolverQueueItem_Ptr > SolverQueueItemList
Definition: Types.h:45
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
Definition: String.cc:36
static void SATSolutionToPool(PoolItem item, const ResStatus &status, const ResStatus::TransactByValue causer)
Definition: SATResolver.cc:245
bool isKind(const ResKind &kind_r) const
Definition: SolvableType.h:64
bool multiversionInstall() const
Definition: SolvableType.h:82
#define ERR
Definition: Logger.h:66
bool setToBeUninstalledDueToUpgrade(TransactByValue causer)
Definition: ResStatus.h:560
#define MAYBE_CLEANDEPS
Definition: SATResolver.cc:117
std::vector< StoreType > _patch
static const ResStatus toBeUninstalledDueToUpgrade
Definition: ResStatus.h:655
std::unary_function< ResObject::constPtr, bool > ResObjectFilterFunctor
Definition: ResFilters.h:151
bool equivalent(const Vendor &lVendor, const Vendor &rVendor) const
Return whether two vendor strings should be treated as the same vendor.
Definition: VendorAttr.cc:264
CheckIfUpdate(const sat::Solvable &installed_r)
Definition: SATResolver.cc:355
::_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
Definition: PoolMember.h:90
Queue StringQueue
Queue with String ids.
Definition: Queue.h:27
std::list< ResolverProblem_Ptr > ResolverProblemList
Definition: ProblemTypes.h:46
static Pool instance()
Singleton ctor.
Definition: Pool.h:53
Commit helper functor distributing PoolItem by status into lists.
Definition: SATResolver.cc:282
bool operator()(const PoolItem &item)
Definition: SATResolver.cc:362
std::ostream & dumpRange(std::ostream &str, TIterator begin, TIterator end, const std::string &intro="{", const std::string &pfx="\n ", const std::string &sep="\n ", const std::string &sfx="\n", const std::string &extro="}")
Print range defined by iterators (multiline style).
Definition: LogTools.h:91
int vendorCheck(sat::detail::CPool *pool, Solvable *solvable1, Solvable *solvable2)
Definition: SATResolver.cc:123
Package interface.
Definition: Package.h:32
std::unary_function< PoolItem, bool > PoolItemFilterFunctor
Definition: ResFilters.h:285
#define WAR
Definition: Logger.h:65
bool HACKENV(const char *var_r, bool default_r)
Definition: SATResolver.cc:64
#define HACKENV(X, D)
Focus on applying as little changes to the installed packages as needed.
ResStatus & status() const
Returns the current status.
Definition: PoolItem.cc:204
#define _(MSG)
Definition: Gettext.h:29
SATCollectTransact(PoolItemList &items_to_install_r, PoolItemList &items_to_remove_r, PoolItemList &items_to_lock_r, PoolItemList &items_to_keep_r, bool solveSrcPackages_r)
Definition: SATResolver.cc:284
bool isPseudoInstalled(ResKind kind_r)
Those are denoted to be installed, if the solver verifies them as being satisfied.
Definition: ResTraits.h:28
bool operator()(const PoolItem &item_r)
Definition: SATResolver.cc:301
bool setToBeUninstalled(TransactByValue causer)
Definition: ResStatus.h:536
FindPackage(ProblemSolutionCombi *p, const TransactionKind act)
Definition: SATResolver.cc:952
bool compareByNVR(const SolvableType< Derived > &lhs, const Solvable &rhs)
Definition: SolvableType.h:261
std::unordered_set< Capability > CapabilitySet
Definition: Capability.h:33
ResKind kind() const
The Solvables ResKind.
Definition: Solvable.cc:275
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
Definition: Selectable.cc:28
SrcPackage interface.
Definition: SrcPackage.h:29
sat::Solvable mapBuddy(sat::Solvable item_r)
Definition: SATResolver.cc:984
sat::Solvable buddy() const
Return the buddy we share our status object with.
Definition: PoolItem.cc:206
Pathname systemRoot() const
The target root directory.
Definition: ZConfig.cc:824
PoolItem getPoolItem(Id id_r)
Definition: SATResolver.cc:146
bool isToBeInstalled() const
Definition: ResStatus.h:244
Solvable satSolvable() const
Return the corresponding sat::Solvable.
Definition: SolvableType.h:57
bool strToBool(const C_Str &str, bool default_r)
Parse str into a bool depending on the default value.
Definition: String.h:445
Chain< TACondition, TBCondition > chain(TACondition conda_r, TBCondition condb_r)
Convenience function for creating a Chain from two conditions conda_r and condb_r.
Definition: Functional.h:346
void prepare() const
Update housekeeping data if necessary (e.g.
Definition: Pool.cc:61
bool setToBeInstalled(TransactByValue causer)
Definition: ResStatus.h:522
std::ostream & dumpRangeLine(std::ostream &str, TIterator begin, TIterator end)
Print range defined by iterators (single line style).
Definition: LogTools.h:114
Status bitfield.
Definition: ResStatus.h:53
IMPL_PTR_TYPE(SATResolver)
Combining sat::Solvable and ResStatus.
Definition: PoolItem.h:50
IdType id() const
Expert backdoor.
Definition: Solvable.h:423
static const IdString retractedToken
Indicator provides retracted-patch-package()
Definition: Solvable.h:58
void resetWeak()
Definition: ResStatus.h:197
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
Definition: ResPool.cc:70
static const VendorAttr & instance()
Singleton.
Definition: VendorAttr.cc:121
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
Definition: Solvable.cc:302
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
std::string itemToString(const PoolItem &item)
Definition: SATResolver.cc:130
#define XDEBUG(x)
Definition: SATResolver.cc:55
Focus on installing the best version of the requested packages.
static const ResStatus toBeUninstalled
Definition: ResStatus.h:654
std::vector< StoreType > _ptf
static ResPool instance()
Singleton ctor.
Definition: ResPool.cc:33