23 #include <solv/repo_solv.h>
24 #include <solv/poolarch.h>
26 #include <solv/poolvendor.h>
27 #include <solv/policy.h>
28 #include <solv/bitmap.h>
29 #include <solv/queue.h>
32 #define ZYPP_USE_RESOLVER_INTERNALS
58 #define XDEBUG(x) do { if (base::logger::isExcessive()) XXX << x << std::endl;} while (0)
60 #undef ZYPP_BASE_LOGGER_LOGGROUP
61 #define ZYPP_BASE_LOGGER_LOGGROUP "zypp::solver"
82 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
83 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
86 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 1 );
87 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
90 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
91 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 1 );
99 inline sat::Queue collectPseudoInstalled(
const ResPool & pool_r )
102 for (
const PoolItem & pi : pool_r )
110 inline void solverCopyBackWeak(
sat::detail::CSolver & satSolver_r, PoolItemList & orphanedItems_r )
114 sat::Queue recommendations;
115 sat::Queue suggestions;
116 ::solver_get_recommendations( &satSolver_r, recommendations, suggestions, 0 );
118 PoolItem(sat::Solvable(recommendations[i])).status().setRecommended(
true );
120 PoolItem(sat::Solvable(suggestions[i])).status().setSuggested(
true );
123 orphanedItems_r.clear();
125 ::solver_get_orphaned( &satSolver_r, orphaned );
128 PoolItem pi { sat::Solvable(orphaned[i]) };
129 pi.status().setOrphaned(
true );
130 orphanedItems_r.push_back( pi );
135 ::solver_get_unneeded( &satSolver_r, unneeded, 1 );
137 PoolItem(sat::Solvable(unneeded[i])).status().setUnneeded(
true );
142 inline void solverCopyBackValidate(
sat::detail::CSolver & satSolver_r,
const ResPool & pool_r )
144 sat::Queue pseudoItems { collectPseudoInstalled( pool_r ) };
145 if ( ! pseudoItems.empty() )
147 sat::Queue pseudoFlags;
148 ::solver_trivial_installable( &satSolver_r, pseudoItems, pseudoFlags );
152 PoolItem pi { sat::Solvable(pseudoItems[i]) };
153 switch ( pseudoFlags[i] )
155 case 0: pi.status().setBroken();
break;
156 case 1: pi.status().setSatisfied();
break;
157 case -1: pi.status().setNonRelevant();
break;
158 default: pi.status().setUndetermined();
break;
171 #define MAYBE_CLEANDEPS (cleandepsOnRemove()?SOLVER_CLEANDEPS:0)
180 IdString(solvable2->vendor) ) ? 0 : 1;
190 if ( ! pseudoItems_r.
empty() )
192 MIL <<
"Establish..." << endl;
194 ::pool_set_custom_vendorcheck( cPool, &
vendorCheck );
200 jobQueue.
push( SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
201 jobQueue.
push( solv.id() );
206 if ( ::solver_solve( cSolver, jobQueue ) != 0 )
207 INT <<
"How can establish fail?" << endl;
209 ::solver_trivial_installable( cSolver, pseudoItems_r, pseudoFlags_r );
214 switch ( pseudoFlags_r[i] )
216 case 0: pi.status().setBroken();
break;
217 case 1: pi.status().setSatisfied();
break;
218 case -1: pi.status().setNonRelevant();
break;
219 default: pi.status().setUndetermined();
break;
222 MIL <<
"Establish DONE" << endl;
225 MIL <<
"Establish not needed." << endl;
231 return std::string();
249 os <<
"<resolver>" << endl;
251 #define OUTS(X) os << " " << #X << "\t= " << solver_get_flag(_satSolver, SOLVER_FLAG_##X) << endl
252 OUTS( ALLOW_DOWNGRADE );
253 OUTS( ALLOW_ARCHCHANGE );
254 OUTS( ALLOW_VENDORCHANGE );
255 OUTS( ALLOW_NAMECHANGE );
256 OUTS( ALLOW_UNINSTALL );
257 OUTS( NO_UPDATEPROVIDE );
258 OUTS( SPLITPROVIDES );
259 OUTS( IGNORE_RECOMMENDED );
260 OUTS( ADD_ALREADY_RECOMMENDED );
261 OUTS( NO_INFARCHCHECK );
262 OUTS( KEEP_EXPLICIT_OBSOLETES );
263 OUTS( BEST_OBEY_POLICY );
264 OUTS( NO_AUTOTARGET );
265 OUTS( DUP_ALLOW_DOWNGRADE );
266 OUTS( DUP_ALLOW_ARCHCHANGE );
267 OUTS( DUP_ALLOW_VENDORCHANGE );
268 OUTS( DUP_ALLOW_NAMECHANGE );
269 OUTS( KEEP_ORPHANS );
270 OUTS( BREAK_ORPHANS );
271 OUTS( YUM_OBSOLETES );
273 os <<
" focus = " << _focus << endl;
274 os <<
" distupgrade = " << _distupgrade << endl;
275 os <<
" distupgrade_removeunsupported = " << _distupgrade_removeunsupported << endl;
276 os <<
" solveSrcPackages = " << _solveSrcPackages << endl;
277 os <<
" cleandepsOnRemove = " << _cleandepsOnRemove << endl;
278 os <<
" fixsystem = " << _fixsystem << endl;
282 return os <<
"<resolver/>" << endl;
292 , _focus ( ZConfig::instance().solver_focus() )
294 , _allowdowngrade ( false )
295 , _allownamechange ( true )
296 , _allowarchchange ( false )
298 , _allowuninstall ( false )
299 , _updatesystem(false)
300 , _noupdateprovide ( false )
301 , _dosplitprovides ( true )
302 , _onlyRequires (ZConfig::instance().solver_onlyRequires())
303 , _ignorealreadyrecommended(true)
304 , _distupgrade(false)
305 , _distupgrade_removeunsupported(false)
310 , _solveSrcPackages(false)
311 , _cleandepsOnRemove(ZConfig::instance().solver_cleandepsOnRemove())
316 SATResolver::~SATResolver()
324 SATResolver::pool (
void)
const
346 XDEBUG(
"SATSolutionToPool install returns " << item <<
", " << r);
350 XDEBUG(
"SATSolutionToPool upgrade returns " << item <<
", " << r);
354 XDEBUG(
"SATSolutionToPool remove returns " << item <<
", " << r);
375 PoolItemList & items_to_remove_r,
376 PoolItemList & items_to_lock_r,
377 PoolItemList & items_to_keep_r,
378 bool solveSrcPackages_r )
379 : _items_to_install( items_to_install_r )
380 , _items_to_remove( items_to_remove_r )
381 , _items_to_lock( items_to_lock_r )
382 , _items_to_keep( items_to_keep_r )
383 , _solveSrcPackages( solveSrcPackages_r )
385 _items_to_install.clear();
386 _items_to_remove.clear();
387 _items_to_lock.clear();
388 _items_to_keep.clear();
413 itemStatus.
isUninstalled() ? _items_to_install.push_back( item_r )
414 : _items_to_remove.push_back( item_r );
break;
446 : is_updated( false )
447 , _installed( installed_r )
471 _satSolver = solver_create( _satPool );
472 ::pool_set_custom_vendorcheck( _satPool, &
vendorCheck );
474 queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
475 queue_push( &(_jobQueue), 0 );
478 queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
479 queue_push( &(_jobQueue), 0 );
482 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
483 queue_push( &(_jobQueue), 0 );
485 if (_distupgrade_removeunsupported) {
486 queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
487 queue_push( &(_jobQueue), 0 );
489 solverSetFocus( *_satSolver, _focus );
490 solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
491 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
492 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
493 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
495 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
496 solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide);
497 solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
498 solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED,
false);
499 solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires);
508 MIL <<
"Starting solving...." << endl;
510 if ( solver_solve( _satSolver, &(_jobQueue) ) == 0 )
517 if ( _distupgrade_removeunsupported )
518 MIL <<
"Droplist processing not needed. RemoveUnsupported is On." << endl;
520 MIL <<
"Droplist processing is disabled in ZConfig." << endl;
523 bool resolve =
false;
524 MIL <<
"Checking droplists ..." << endl;
527 solver_get_decisionqueue( _satSolver, decisionq );
534 static const Capability productCap {
"product()" };
535 if ( slv && slv.provides().matches( productCap ) )
537 CapabilitySet droplist { slv.valuesOfNamespace(
"weakremover" ) };
538 MIL <<
"Droplist for " << slv <<
": size " << droplist.size() << endl;
539 if ( !droplist.empty() )
541 for (
const auto & cap : droplist )
543 queue_push( &_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
544 queue_push( &_jobQueue, cap.id() );
547 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
548 queue_push( &(_jobQueue),
id );
554 solver_solve( _satSolver, &(_jobQueue) );
558 MIL <<
"....Solver end" << endl;
562 _result_items_to_install.clear();
563 _result_items_to_remove.clear();
567 queue_init(&decisionq);
568 solver_get_decisionqueue(_satSolver, &decisionq);
569 for (
int i = 0; i < decisionq.count; ++i )
571 Id p = decisionq.elements[i];
576 if ( ! slv || slv.isSystem() )
579 PoolItem poolItem( slv );
581 _result_items_to_install.push_back( poolItem );
583 queue_free(&decisionq);
587 if ( systemRepo && ! systemRepo.solvablesEmpty() )
589 bool mustCheckObsoletes =
false;
590 for_( it, systemRepo.solvablesBegin(), systemRepo.solvablesEnd() )
592 if (solver_get_decisionlevel(_satSolver, it->id()) > 0)
596 CheckIfUpdate info( *it );
597 PoolItem poolItem( *it );
599 _pool.byIdentEnd( poolItem ),
600 resfilter::ByUninstalled(),
601 functor::functorRef<bool,PoolItem> (info) );
603 if (info.is_updated) {
607 if ( ! mustCheckObsoletes )
608 mustCheckObsoletes =
true;
610 _result_items_to_remove.push_back (poolItem);
612 if ( mustCheckObsoletes )
614 sat::WhatObsoletes obsoleted( _result_items_to_install.begin(), _result_items_to_install.end() );
615 for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
617 ResStatus & status( it->status() );
619 if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
620 status.setToBeUninstalledDueToObsolete();
627 solverCopyBackWeak( *_satSolver, _problem_items );
628 solverCopyBackValidate( *_satSolver, _pool );
633 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
634 sat::WhatProvides rpmProviders(*iter);
635 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
636 PoolItem poolItem(*iter2);
637 if (poolItem.status().isToBeInstalled()) {
638 MIL <<
"User requirement " << *iter <<
" sets " << poolItem << endl;
643 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
644 sat::WhatProvides rpmProviders(*iter);
645 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
646 PoolItem poolItem(*iter2);
647 if (poolItem.status().isToBeUninstalled()) {
648 MIL <<
"User conflict " << *iter <<
" sets " << poolItem << endl;
654 if (solver_problem_count(_satSolver) > 0 )
656 ERR <<
"Solverrun finished with an ERROR" << endl;
665 SATResolver::solverInit(
const PoolItemList & weakItems)
668 MIL <<
"SATResolver::solverInit()" << endl;
672 queue_init( &_jobQueue );
676 SATCollectTransact collector( _items_to_install, _items_to_remove, _items_to_lock, _items_to_keep, solveSrcPackages() );
677 invokeOnEach ( _pool.begin(), _pool.end(), functor::functorRef<bool,PoolItem>( collector ) );
680 for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
681 Id
id = (*iter)->satSolvable().id();
683 ERR <<
"Weaken: " << *iter <<
" not found" << endl;
685 MIL <<
"Weaken dependencies of " << *iter << endl;
686 queue_push( &(_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
687 queue_push( &(_jobQueue),
id );
692 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
694 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
700 const auto & trackedLocaleIds( myPool().trackedLocaleIds() );
703 for (
const auto & locale : trackedLocaleIds.added() )
705 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
709 for (
const auto & locale : trackedLocaleIds.removed() )
711 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES | SOLVER_CLEANDEPS );
717 for (
const sat::Solvable & solv : myPool().multiversionList() )
719 queue_push( &(_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
720 queue_push( &(_jobQueue), solv.id() );
723 ::pool_add_userinstalled_jobs(_satPool,
sat::Pool::instance().autoInstalled(), &(_jobQueue), GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED);
727 SATResolver::solverEnd()
732 solver_free(_satSolver);
734 queue_free( &(_jobQueue) );
740 SATResolver::resolvePool(
const CapabilitySet & requires_caps,
742 const PoolItemList & weakItems,
743 const std::set<Repository> & upgradeRepos)
745 MIL <<
"SATResolver::resolvePool()" << endl;
748 solverInit(weakItems);
750 for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
751 Id
id = (*iter)->satSolvable().id();
753 ERR <<
"Install: " << *iter <<
" not found" << endl;
755 MIL <<
"Install " << *iter << endl;
756 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
757 queue_push( &(_jobQueue),
id );
761 for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
762 Id
id = (*iter)->satSolvable().id();
764 ERR <<
"Delete: " << *iter <<
" not found" << endl;
766 MIL <<
"Delete " << *iter << endl;
767 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
768 queue_push( &(_jobQueue),
id);
772 for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
774 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
775 queue_push( &(_jobQueue), iter->get()->repoid );
776 MIL <<
"Upgrade repo " << *iter << endl;
779 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
780 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
781 queue_push( &(_jobQueue), iter->id() );
782 MIL <<
"Requires " << *iter << endl;
785 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
786 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
787 queue_push( &(_jobQueue), iter->id() );
788 MIL <<
"Conflicts " << *iter << endl;
792 setSystemRequirements();
798 bool ret = solving(requires_caps, conflict_caps);
800 (ret?
MIL:
WAR) <<
"SATResolver::resolvePool() done. Ret:" << ret << endl;
807 const PoolItemList & weakItems)
809 MIL <<
"SATResolver::resolvQueue()" << endl;
812 solverInit(weakItems);
815 for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
816 (*iter)->addRule(_jobQueue);
820 for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
821 Id
id = (*iter)->satSolvable().id();
823 ERR <<
"Install: " << *iter <<
" not found" << endl;
825 MIL <<
"Install " << *iter << endl;
826 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
827 queue_push( &(_jobQueue),
id );
830 for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
832 MIL <<
"Delete " << *iter << ident << endl;
833 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME |
MAYBE_CLEANDEPS );
834 queue_push( &(_jobQueue), ident);
838 setSystemRequirements();
844 bool ret = solving();
846 MIL <<
"SATResolver::resolveQueue() done. Ret:" << ret << endl;
851 void SATResolver::doUpdate()
853 MIL <<
"SATResolver::doUpdate()" << endl;
856 solverInit(PoolItemList());
859 setSystemRequirements();
864 _satSolver = solver_create( _satPool );
865 ::pool_set_custom_vendorcheck( _satPool, &
vendorCheck );
867 queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
868 queue_push( &(_jobQueue), 0 );
871 queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
872 queue_push( &(_jobQueue), 0 );
875 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
876 queue_push( &(_jobQueue), 0 );
878 if (_distupgrade_removeunsupported) {
879 queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
880 queue_push( &(_jobQueue), 0 );
882 solverSetFocus( *_satSolver, _focus );
883 solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
884 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
885 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
886 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
888 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
889 solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide);
890 solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
891 solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED,
false);
892 solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires);
897 MIL <<
"Starting solving for update...." << endl;
899 solver_solve( _satSolver, &(_jobQueue) );
900 MIL <<
"....Solver end" << endl;
907 queue_init(&decisionq);
908 solver_get_decisionqueue(_satSolver, &decisionq);
909 for (
int i = 0; i < decisionq.count; i++)
911 Id p = decisionq.elements[i];
916 if ( ! solv || solv.isSystem() )
921 queue_free(&decisionq);
924 for (
int i = _satSolver->pool->installed->start; i < _satSolver->pool->installed->start + _satSolver->pool->installed->nsolvables; i++)
926 if (solver_get_decisionlevel(_satSolver, i) > 0)
929 PoolItem poolItem( _pool.find( sat::Solvable(i) ) );
932 CheckIfUpdate info( (sat::Solvable(i)) );
934 _pool.byIdentEnd( poolItem ),
935 resfilter::ByUninstalled(),
936 functor::functorRef<bool,PoolItem> (info) );
938 if (info.is_updated) {
944 ERR <<
"id " << i <<
" not found in ZYPP pool." << endl;
950 solverCopyBackWeak( *_satSolver, _problem_items );
951 solverCopyBackValidate( *_satSolver, _pool );
953 MIL <<
"SATResolver::doUpdate() done" << endl;
973 : problemSolution (p)
980 problemSolution->addSingleAction (p, action);
1013 std::vector<std::string> SATResolver::SATgetCompleteProblemInfoStrings ( Id problem )
1015 std::vector<std::string> ret;
1016 sat::Queue problems;
1017 solver_findallproblemrules( _satSolver, problem, problems );
1023 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1024 if ( ruleClass != SolverRuleinfo::SOLVER_RULE_UPDATE && ruleClass != SolverRuleinfo::SOLVER_RULE_JOB ) {
1030 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1031 if ( nobad && ( ruleClass == SolverRuleinfo::SOLVER_RULE_UPDATE || ruleClass == SolverRuleinfo::SOLVER_RULE_JOB ) ) {
1037 std::string pInfo = SATproblemRuleInfoString( problems[i], detail, ignore );
1040 if ( std::find( ret.begin(), ret.end(), pInfo ) == ret.end() )
1041 ret.push_back( pInfo );
1046 std::string SATResolver::SATprobleminfoString(Id problem, std::string &detail, Id &ignoreId)
1050 Id probr = solver_findproblemrule(_satSolver, problem);
1051 return SATproblemRuleInfoString( probr, detail, ignoreId );
1054 #ifdef ZYPPNEWSPPSWENPPYZ
1055 #warning New texts in SP preview - still to be translated...
1056 std::string SATResolver::SATproblemRuleInfoString (Id probr, std::string &detail, Id &ignoreId)
1060 Id dep, source, target;
1061 SolverRuleinfo type = solver_ruleinfo(_satSolver, probr, &source, &target, &dep);
1065 sat::Solvable s = mapSolvable( source );
1066 sat::Solvable s2 = mapSolvable( target );
1073 case SOLVER_RULE_DISTUPGRADE:
1075 ret = str::Format(
_(
"the installed %1% does not belong to a distupgrade repository and must be replaced") ) % s.asString();
1077 ret = str::Format(
_(
"the to be installed %1% does not belong to a distupgrade repository") ) % s.asString();
1079 case SOLVER_RULE_INFARCH:
1081 ret = str::Format(
_(
"the installed %1% has inferior architecture") ) % s.asString();
1083 ret = str::Format(
_(
"the to be installed %1% has inferior architecture") ) % s.asString();
1085 case SOLVER_RULE_UPDATE:
1086 ret = str::Format(
_(
"problem with the installed %1%") ) % s.asString();
1088 case SOLVER_RULE_JOB:
1089 ret =
_(
"conflicting requests");
1091 case SOLVER_RULE_PKG:
1092 ret =
_(
"some dependency problem");
1094 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1095 ret = str::Format(
_(
"nothing provides the requested '%1%'") ) % pool_dep2str(pool, dep);
1096 detail +=
_(
"Have you enabled all the required repositories?");
1098 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1099 ret = str::Format(
_(
"the requested package %1% does not exist") ) % pool_dep2str(pool, dep);
1100 detail +=
_(
"Have you enabled all the required repositories?");
1102 case SOLVER_RULE_JOB_UNSUPPORTED:
1103 ret =
_(
"unsupported request");
1105 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1106 ret = str::Format(
_(
"'%1%' is provided by the system and cannot be erased") ) % pool_dep2str(pool, dep);
1108 case SOLVER_RULE_PKG_NOT_INSTALLABLE:
1109 ret = str::Format(
_(
"%1% is not installable") ) % s.asString();
1111 case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
1114 ret = str::Format(
_(
"nothing provides '%1%' needed by the installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1116 ret = str::Format(
_(
"nothing provides '%1%' needed by the to be installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1118 case SOLVER_RULE_PKG_SAME_NAME:
1119 ret = str::Format(
_(
"cannot install both %1% and %2%") ) % s.asString() % s2.asString();
1121 case SOLVER_RULE_PKG_CONFLICTS:
1122 if ( s.isSystem() ) {
1123 if ( s2.isSystem() )
1124 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1126 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1129 if ( s2.isSystem() )
1130 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1132 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1135 case SOLVER_RULE_PKG_OBSOLETES:
1136 case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
1137 if ( s.isSystem() ) {
1138 if ( s2.isSystem() )
1139 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1141 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1144 if ( s2.isSystem() )
1145 ret = str::Format(
_(
"the to be installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1147 ret = str::Format(
_(
"the to be installed %1% obsoletes '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1150 case SOLVER_RULE_PKG_SELF_CONFLICT:
1152 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1154 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1156 case SOLVER_RULE_PKG_REQUIRES: {
1158 Capability cap(dep);
1159 sat::WhatProvides possibleProviders(cap);
1162 typedef std::list<PoolItem> ProviderList;
1163 ProviderList providerlistInstalled, providerlistUninstalled;
1164 for_( iter1, possibleProviders.begin(), possibleProviders.end() ) {
1168 for_( iter2, possibleProviders.begin(), possibleProviders.end() ) {
1171 && ( (provider1.status().isInstalled() && provider2.status().isUninstalled())
1172 || (provider2.status().isInstalled() && provider1.status().isUninstalled()) )) {
1178 if (provider1.status().isInstalled())
1179 providerlistInstalled.push_back(provider1);
1181 providerlistUninstalled.push_back(provider1);
1186 ret = str::Format(
_(
"the installed %1% requires '%2%', but this requirement cannot be provided") ) % s.
asString() % pool_dep2str(pool, dep);
1188 ret = str::Format(
_(
"the to be installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1189 if (providerlistInstalled.size() > 0) {
1190 detail +=
_(
"deleted providers: ");
1191 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1192 if (iter == providerlistInstalled.begin())
1198 if (providerlistUninstalled.size() > 0) {
1199 if (detail.size() > 0)
1200 detail +=
_(
"\nnot installable providers: ");
1202 detail =
_(
"not installable providers: ");
1203 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1204 if (iter == providerlistUninstalled.begin())
1213 DBG <<
"Unknown rule type(" << type <<
") going to query libsolv for rule information." << endl;
1214 ret =
str::asString( ::solver_problemruleinfo2str( _satSolver, type,
static_cast<Id
>(s.id()),
static_cast<Id
>(s2.id()), dep ) );
1222 SATResolver::problems ()
1225 if (_satSolver && solver_problem_count(_satSolver)) {
1229 Id problem, solution, element;
1230 sat::Solvable s, sd;
1232 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1233 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1235 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1238 while ((problem = solver_next_problem(_satSolver, problem)) != 0) {
1239 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1240 MIL <<
"====================================" << endl;
1243 std::string whatString = SATprobleminfoString (problem,detail,ignoreId);
1244 MIL << whatString << endl;
1245 MIL <<
"------------------------------------" << endl;
1246 ResolverProblem_Ptr resolverProblem =
new ResolverProblem (whatString, detail, SATgetCompleteProblemInfoStrings( problem ));
1249 while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
1251 ProblemSolutionCombi *problemSolution =
new ProblemSolutionCombi;
1252 while ((element = solver_next_solutionelement(_satSolver, problem, solution, element, &p, &rp)) != 0) {
1253 if (p == SOLVER_SOLUTION_JOB) {
1255 what = _jobQueue.elements[rp];
1256 switch (_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1258 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1259 s = mapSolvable (what);
1260 PoolItem poolItem = _pool.find (s);
1262 if (pool->installed && s.get()->repo == pool->installed) {
1263 problemSolution->addSingleAction (poolItem, REMOVE);
1264 std::string description = str::Format(
_(
"remove lock to allow removal of %1%") ) % s.asString();
1265 MIL << description << endl;
1266 problemSolution->addDescription (description);
1268 problemSolution->addSingleAction (poolItem, KEEP);
1269 std::string description = str::Format(
_(
"do not install %1%") ) % s.asString();
1270 MIL << description << endl;
1271 problemSolution->addDescription (description);
1274 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.asString() << endl;
1278 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1279 s = mapSolvable (what);
1280 PoolItem poolItem = _pool.find (s);
1282 if (pool->installed && s.get()->repo == pool->installed) {
1283 problemSolution->addSingleAction (poolItem, KEEP);
1284 std::string description = str::Format(
_(
"keep %1%") ) % s.asString();
1285 MIL << description << endl;
1286 problemSolution->addDescription (description);
1288 problemSolution->addSingleAction (poolItem, UNLOCK);
1289 std::string description = str::Format(
_(
"remove lock to allow installation of %1%") ) %
itemToString( poolItem );
1290 MIL << description << endl;
1291 problemSolution->addDescription (description);
1294 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.asString() << endl;
1298 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1300 IdString ident( what );
1301 SolverQueueItemInstall_Ptr install =
1302 new SolverQueueItemInstall(_pool, ident.asString(),
false );
1303 problemSolution->addSingleAction (install, REMOVE_SOLVE_QUEUE_ITEM);
1305 std::string description = str::Format(
_(
"do not install %1%") ) % ident;
1306 MIL << description << endl;
1307 problemSolution->addDescription (description);
1310 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1314 IdString ident( what );
1315 FindPackage info (problemSolution, KEEP);
1317 _pool.byIdentEnd( ident ),
1319 resfilter::ByTransact ()),
1320 functor::functorRef<bool,PoolItem> (info) );
1322 SolverQueueItemDelete_Ptr del =
1323 new SolverQueueItemDelete(_pool, ident.asString(),
false );
1324 problemSolution->addSingleAction (del, REMOVE_SOLVE_QUEUE_ITEM);
1326 std::string description = str::Format(
_(
"keep %1%") ) % ident;
1327 MIL << description << endl;
1328 problemSolution->addDescription (description);
1331 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1333 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_REQUIRE);
1334 std::string description =
"";
1337 if (system_requires.find(Capability(what)) != system_requires.end()) {
1339 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1340 resolverProblem->setDescription(
_(
"This request will break your system!"));
1341 description =
_(
"ignore the warning of a broken system");
1342 description += std::string(
" (requires:")+pool_dep2str(pool, what)+
")";
1343 MIL << description << endl;
1344 problemSolution->addFrontDescription (description);
1346 description = str::Format(
_(
"do not ask to install a solvable providing %1%") ) % pool_dep2str(pool, what);
1347 MIL << description << endl;
1348 problemSolution->addDescription (description);
1352 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1354 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_CONFLICT);
1355 std::string description =
"";
1358 if (system_conflicts.find(Capability(what)) != system_conflicts.end()) {
1360 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1361 resolverProblem->setDescription(
_(
"This request will break your system!"));
1362 description =
_(
"ignore the warning of a broken system");
1363 description += std::string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1364 MIL << description << endl;
1365 problemSolution->addFrontDescription (description);
1368 description = str::Format(
_(
"do not ask to delete all solvables providing %1%") ) % pool_dep2str(pool, what);
1369 MIL << description << endl;
1370 problemSolution->addDescription (description);
1374 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1376 s = mapSolvable (what);
1377 PoolItem poolItem = _pool.find (s);
1379 if (pool->installed && s.get()->repo == pool->installed) {
1380 problemSolution->addSingleAction (poolItem, KEEP);
1381 std::string description = str::Format(
_(
"do not install most recent version of %1%") ) % s.asString();
1382 MIL << description << endl;
1383 problemSolution->addDescription (description);
1385 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1388 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.asString() << endl;
1393 MIL <<
"- do something different" << endl;
1394 ERR <<
"No valid solution available" << endl;
1397 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1398 s = mapSolvable (rp);
1399 PoolItem poolItem = _pool.find (s);
1400 if (pool->installed && s.get()->repo == pool->installed) {
1401 problemSolution->addSingleAction (poolItem, LOCK);
1402 std::string description = str::Format(
_(
"keep %1% despite the inferior architecture") ) % s.asString();
1403 MIL << description << endl;
1404 problemSolution->addDescription (description);
1406 problemSolution->addSingleAction (poolItem, INSTALL);
1407 std::string description = str::Format(
_(
"install %1% despite the inferior architecture") ) % s.asString();
1408 MIL << description << endl;
1409 problemSolution->addDescription (description);
1411 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1412 s = mapSolvable (rp);
1413 PoolItem poolItem = _pool.find (s);
1414 if (pool->installed && s.get()->repo == pool->installed) {
1415 problemSolution->addSingleAction (poolItem, LOCK);
1416 std::string description = str::Format(
_(
"keep obsolete %1%") ) % s.asString();
1417 MIL << description << endl;
1418 problemSolution->addDescription (description);
1420 problemSolution->addSingleAction (poolItem, INSTALL);
1421 std::string description = str::Format(
_(
"install %1% from excluded repository") ) % s.asString();
1422 MIL << description << endl;
1423 problemSolution->addDescription (description);
1425 }
else if ( p == SOLVER_SOLUTION_BLACK ) {
1428 s = mapSolvable (rp);
1429 PoolItem poolItem = _pool.find (s);
1431 problemSolution->addSingleAction (poolItem, INSTALL);
1432 std::string description;
1433 if ( s.isRetracted() ) {
1435 description = str::Format(
_(
"install %1% although it has been retracted")) % s.asString();
1436 }
else if ( s.isPtf() ) {
1438 description = str::Format(
_(
"allow installing the PTF %1%")) % s.asString();
1441 description = str::Format(
_(
"install %1% although it is blacklisted")) % s.asString();
1443 MIL << description << endl;
1444 problemSolution->addDescription( description );
1445 }
else if ( p > 0 ) {
1447 s = mapSolvable (p);
1448 PoolItem itemFrom = _pool.find (s);
1453 sd = mapSolvable (rp);
1454 PoolItem itemTo = _pool.find (sd);
1455 if (itemFrom && itemTo) {
1456 problemSolution->addSingleAction (itemTo, INSTALL);
1457 int illegal = policy_is_illegal(_satSolver, s.get(), sd.get(), 0);
1459 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1461 std::string description = str::Format(
_(
"downgrade of %1% to %2%") ) % s.asString() % sd.asString();
1462 MIL << description << endl;
1463 problemSolution->addDescription (description);
1466 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1468 std::string description = str::Format(
_(
"architecture change of %1% to %2%") ) % s.asString() % sd.asString();
1469 MIL << description << endl;
1470 problemSolution->addDescription (description);
1473 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1475 IdString s_vendor( s.vendor() );
1476 IdString sd_vendor( sd.vendor() );
1477 std::string description = str::Format(
_(
"install %1% (with vendor change)\n %2% --> %3%") ) % sd.asString() % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " ) % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " );
1478 MIL << description << endl;
1479 problemSolution->addDescription (description);
1483 std::string description = str::Format(
_(
"replacement of %1% with %2%") ) % s.asString() % sd.asString();
1484 MIL << description << endl;
1485 problemSolution->addDescription (description);
1488 ERR << s.asString() <<
" or " << sd.asString() <<
" not found" << endl;
1494 std::string description = str::Format(
_(
"deinstallation of %1%") ) % s.asString();
1495 MIL << description << endl;
1496 problemSolution->addDescription (description);
1497 problemSolution->addSingleAction (itemFrom, REMOVE);
1503 INT <<
"Unknown solution " << p << endl;
1507 resolverProblem->addSolution (problemSolution,
1508 problemSolution->actionCount() > 1 ?
true :
false);
1509 MIL <<
"------------------------------------" << endl;
1514 PoolItem item = _pool.find (sat::Solvable(ignoreId));
1515 ProblemSolutionIgnore *problemSolution =
new ProblemSolutionIgnore(item);
1516 resolverProblem->addSolution (problemSolution,
1518 MIL <<
"ignore some dependencies of " << item << endl;
1519 MIL <<
"------------------------------------" << endl;
1523 resolverProblems.push_back (resolverProblem);
1526 return resolverProblems;
1529 #warning Legacy texts
1530 std::string SATResolver::SATproblemRuleInfoString (Id probr, std::string &detail, Id &ignoreId)
1534 Id dep, source, target;
1535 SolverRuleinfo type = solver_ruleinfo(_satSolver, probr, &source, &target, &dep);
1539 sat::Solvable s = mapSolvable( source );
1540 sat::Solvable s2 = mapSolvable( target );
1547 case SOLVER_RULE_DISTUPGRADE:
1548 ret =
str::form (
_(
"%s does not belong to a distupgrade repository"), s.asString().c_str());
1550 case SOLVER_RULE_INFARCH:
1551 ret =
str::form (
_(
"%s has inferior architecture"), s.asString().c_str());
1553 case SOLVER_RULE_UPDATE:
1554 ret =
str::form (
_(
"problem with installed package %s"), s.asString().c_str());
1556 case SOLVER_RULE_JOB:
1557 ret =
_(
"conflicting requests");
1559 case SOLVER_RULE_PKG:
1560 ret =
_(
"some dependency problem");
1562 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1563 ret =
str::form (
_(
"nothing provides requested %s"), pool_dep2str(pool, dep));
1564 detail +=
_(
"Have you enabled all requested repositories?");
1566 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1567 ret =
str::form (
_(
"package %s does not exist"), pool_dep2str(pool, dep));
1568 detail +=
_(
"Have you enabled all requested repositories?");
1570 case SOLVER_RULE_JOB_UNSUPPORTED:
1571 ret =
_(
"unsupported request");
1573 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1574 ret =
str::form (
_(
"%s is provided by the system and cannot be erased"), pool_dep2str(pool, dep));
1576 case SOLVER_RULE_PKG_NOT_INSTALLABLE:
1577 ret =
str::form (
_(
"%s is not installable"), s.asString().c_str());
1579 case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
1581 ret =
str::form (
_(
"nothing provides %s needed by %s"), pool_dep2str(pool, dep), s.asString().c_str());
1583 case SOLVER_RULE_PKG_SAME_NAME:
1584 ret =
str::form (
_(
"cannot install both %s and %s"), s.asString().c_str(), s2.asString().c_str());
1586 case SOLVER_RULE_PKG_CONFLICTS:
1587 ret =
str::form (
_(
"%s conflicts with %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
1589 case SOLVER_RULE_PKG_OBSOLETES:
1590 ret =
str::form (
_(
"%s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
1592 case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
1593 ret =
str::form (
_(
"installed %s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
1595 case SOLVER_RULE_PKG_SELF_CONFLICT:
1596 ret =
str::form (
_(
"solvable %s conflicts with %s provided by itself"), s.asString().c_str(), pool_dep2str(pool, dep));
1598 case SOLVER_RULE_PKG_REQUIRES: {
1600 Capability cap(dep);
1601 sat::WhatProvides possibleProviders(cap);
1604 typedef std::list<PoolItem> ProviderList;
1605 ProviderList providerlistInstalled, providerlistUninstalled;
1606 for_( iter1, possibleProviders.begin(), possibleProviders.end() ) {
1610 for_( iter2, possibleProviders.begin(), possibleProviders.end() ) {
1613 && ( (provider1.status().isInstalled() && provider2.status().isUninstalled())
1614 || (provider2.status().isInstalled() && provider1.status().isUninstalled()) )) {
1620 if (provider1.status().isInstalled())
1621 providerlistInstalled.push_back(provider1);
1623 providerlistUninstalled.push_back(provider1);
1627 ret =
str::form (
_(
"%s requires %s, but this requirement cannot be provided"), s.asString().c_str(), pool_dep2str(pool, dep));
1628 if (providerlistInstalled.size() > 0) {
1629 detail +=
_(
"deleted providers: ");
1630 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1631 if (iter == providerlistInstalled.begin())
1637 if (providerlistUninstalled.size() > 0) {
1638 if (detail.size() > 0)
1639 detail +=
_(
"\nnot installable providers: ");
1641 detail =
_(
"not installable providers: ");
1642 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1643 if (iter == providerlistUninstalled.begin())
1652 DBG <<
"Unknown rule type(" << type <<
") going to query libsolv for rule information." << endl;
1653 ret =
str::asString( ::solver_problemruleinfo2str( _satSolver, type,
static_cast<Id
>(s.id()),
static_cast<Id
>(s2.id()), dep ) );
1661 SATResolver::problems ()
1664 if (_satSolver && solver_problem_count(_satSolver)) {
1668 Id problem, solution, element;
1669 sat::Solvable s, sd;
1671 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1672 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1674 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1677 while ((problem = solver_next_problem(_satSolver, problem)) != 0) {
1678 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1679 MIL <<
"====================================" << endl;
1682 std::string whatString = SATprobleminfoString (problem,detail,ignoreId);
1683 MIL << whatString << endl;
1684 MIL <<
"------------------------------------" << endl;
1685 ResolverProblem_Ptr resolverProblem =
new ResolverProblem (whatString, detail, SATgetCompleteProblemInfoStrings( problem ));
1688 while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
1690 ProblemSolutionCombi *problemSolution =
new ProblemSolutionCombi;
1691 while ((element = solver_next_solutionelement(_satSolver, problem, solution, element, &p, &rp)) != 0) {
1692 if (p == SOLVER_SOLUTION_JOB) {
1694 what = _jobQueue.elements[rp];
1695 switch (_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1697 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1698 s = mapSolvable (what);
1699 PoolItem poolItem = _pool.find (s);
1701 if (pool->installed && s.get()->repo == pool->installed) {
1702 problemSolution->addSingleAction (poolItem, REMOVE);
1703 std::string description =
str::form (
_(
"remove lock to allow removal of %s"), s.asString().c_str() );
1704 MIL << description << endl;
1705 problemSolution->addDescription (description);
1707 problemSolution->addSingleAction (poolItem, KEEP);
1708 std::string description =
str::form (
_(
"do not install %s"), s.asString().c_str());
1709 MIL << description << endl;
1710 problemSolution->addDescription (description);
1713 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.asString() << endl;
1717 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1718 s = mapSolvable (what);
1719 PoolItem poolItem = _pool.find (s);
1721 if (pool->installed && s.get()->repo == pool->installed) {
1722 problemSolution->addSingleAction (poolItem, KEEP);
1723 std::string description =
str::form (
_(
"keep %s"), s.asString().c_str());
1724 MIL << description << endl;
1725 problemSolution->addDescription (description);
1727 problemSolution->addSingleAction (poolItem, UNLOCK);
1728 std::string description =
str::form (
_(
"remove lock to allow installation of %s"),
itemToString( poolItem ).c_str());
1729 MIL << description << endl;
1730 problemSolution->addDescription (description);
1733 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.asString() << endl;
1737 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1739 IdString ident( what );
1740 SolverQueueItemInstall_Ptr install =
1741 new SolverQueueItemInstall(_pool, ident.asString(),
false );
1742 problemSolution->addSingleAction (install, REMOVE_SOLVE_QUEUE_ITEM);
1744 std::string description =
str::form (
_(
"do not install %s"), ident.c_str() );
1745 MIL << description << endl;
1746 problemSolution->addDescription (description);
1749 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1753 IdString ident( what );
1754 FindPackage info (problemSolution, KEEP);
1756 _pool.byIdentEnd( ident ),
1758 resfilter::ByTransact ()),
1759 functor::functorRef<bool,PoolItem> (info) );
1761 SolverQueueItemDelete_Ptr del =
1762 new SolverQueueItemDelete(_pool, ident.asString(),
false );
1763 problemSolution->addSingleAction (del, REMOVE_SOLVE_QUEUE_ITEM);
1765 std::string description =
str::form (
_(
"keep %s"), ident.c_str());
1766 MIL << description << endl;
1767 problemSolution->addDescription (description);
1770 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1772 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_REQUIRE);
1773 std::string description =
"";
1776 if (system_requires.find(Capability(what)) != system_requires.end()) {
1778 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1779 resolverProblem->setDescription(
_(
"This request will break your system!"));
1780 description =
_(
"ignore the warning of a broken system");
1781 description += std::string(
" (requires:")+pool_dep2str(pool, what)+
")";
1782 MIL << description << endl;
1783 problemSolution->addFrontDescription (description);
1785 description =
str::form (
_(
"do not ask to install a solvable providing %s"), pool_dep2str(pool, what));
1786 MIL << description << endl;
1787 problemSolution->addDescription (description);
1791 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1793 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_CONFLICT);
1794 std::string description =
"";
1797 if (system_conflicts.find(Capability(what)) != system_conflicts.end()) {
1799 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1800 resolverProblem->setDescription(
_(
"This request will break your system!"));
1801 description =
_(
"ignore the warning of a broken system");
1802 description += std::string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1803 MIL << description << endl;
1804 problemSolution->addFrontDescription (description);
1807 description =
str::form (
_(
"do not ask to delete all solvables providing %s"), pool_dep2str(pool, what));
1808 MIL << description << endl;
1809 problemSolution->addDescription (description);
1813 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1815 s = mapSolvable (what);
1816 PoolItem poolItem = _pool.find (s);
1818 if (pool->installed && s.get()->repo == pool->installed) {
1819 problemSolution->addSingleAction (poolItem, KEEP);
1820 std::string description =
str::form (
_(
"do not install most recent version of %s"), s.asString().c_str());
1821 MIL << description << endl;
1822 problemSolution->addDescription (description);
1824 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1827 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.asString() << endl;
1832 MIL <<
"- do something different" << endl;
1833 ERR <<
"No valid solution available" << endl;
1836 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1837 s = mapSolvable (rp);
1838 PoolItem poolItem = _pool.find (s);
1839 if (pool->installed && s.get()->repo == pool->installed) {
1840 problemSolution->addSingleAction (poolItem, LOCK);
1841 std::string description =
str::form (
_(
"keep %s despite the inferior architecture"), s.asString().c_str());
1842 MIL << description << endl;
1843 problemSolution->addDescription (description);
1845 problemSolution->addSingleAction (poolItem, INSTALL);
1846 std::string description =
str::form (
_(
"install %s despite the inferior architecture"), s.asString().c_str());
1847 MIL << description << endl;
1848 problemSolution->addDescription (description);
1850 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1851 s = mapSolvable (rp);
1852 PoolItem poolItem = _pool.find (s);
1853 if (pool->installed && s.get()->repo == pool->installed) {
1854 problemSolution->addSingleAction (poolItem, LOCK);
1855 std::string description =
str::form (
_(
"keep obsolete %s"), s.asString().c_str());
1856 MIL << description << endl;
1857 problemSolution->addDescription (description);
1859 problemSolution->addSingleAction (poolItem, INSTALL);
1860 std::string description =
str::form (
_(
"install %s from excluded repository"), s.asString().c_str());
1861 MIL << description << endl;
1862 problemSolution->addDescription (description);
1864 }
else if ( p == SOLVER_SOLUTION_BLACK ) {
1867 s = mapSolvable (rp);
1868 PoolItem poolItem = _pool.find (s);
1870 problemSolution->addSingleAction (poolItem, INSTALL);
1871 std::string description;
1872 if ( s.isRetracted() ) {
1874 description = str::Format(
_(
"install %1% although it has been retracted")) % s.asString();
1875 }
else if ( s.isPtf() ) {
1877 description = str::Format(
_(
"allow to install the PTF %1%")) % s.asString();
1880 description = str::Format(
_(
"install %1% although it is blacklisted")) % s.asString();
1882 MIL << description << endl;
1883 problemSolution->addDescription( description );
1884 }
else if ( p > 0 ) {
1886 s = mapSolvable (p);
1887 PoolItem itemFrom = _pool.find (s);
1892 sd = mapSolvable (rp);
1893 PoolItem itemTo = _pool.find (sd);
1894 if (itemFrom && itemTo) {
1895 problemSolution->addSingleAction (itemTo, INSTALL);
1896 int illegal = policy_is_illegal(_satSolver, s.get(), sd.get(), 0);
1898 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1900 std::string description =
str::form (
_(
"downgrade of %s to %s"), s.asString().c_str(), sd.asString().c_str());
1901 MIL << description << endl;
1902 problemSolution->addDescription (description);
1905 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1907 std::string description =
str::form (
_(
"architecture change of %s to %s"), s.asString().c_str(), sd.asString().c_str());
1908 MIL << description << endl;
1909 problemSolution->addDescription (description);
1912 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1914 IdString s_vendor( s.vendor() );
1915 IdString sd_vendor( sd.vendor() );
1916 std::string description =
str::form (
_(
"install %s (with vendor change)\n %s --> %s") ,
1917 sd.asString().c_str(),
1918 ( s_vendor ? s_vendor.c_str() :
" (no vendor) " ),
1919 ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " ) );
1920 MIL << description << endl;
1921 problemSolution->addDescription (description);
1925 std::string description =
str::form (
_(
"replacement of %s with %s"), s.asString().c_str(), sd.asString().c_str());
1926 MIL << description << endl;
1927 problemSolution->addDescription (description);
1930 ERR << s.asString() <<
" or " << sd.asString() <<
" not found" << endl;
1936 std::string description =
str::form (
_(
"deinstallation of %s"), s.asString().c_str());
1937 MIL << description << endl;
1938 problemSolution->addDescription (description);
1939 problemSolution->addSingleAction (itemFrom, REMOVE);
1945 INT <<
"Unknown solution " << p << endl;
1949 resolverProblem->addSolution (problemSolution,
1950 problemSolution->actionCount() > 1 ?
true :
false);
1951 MIL <<
"------------------------------------" << endl;
1956 PoolItem item = _pool.find (sat::Solvable(ignoreId));
1957 ProblemSolutionIgnore *problemSolution =
new ProblemSolutionIgnore(item);
1958 resolverProblem->addSolution (problemSolution,
1960 MIL <<
"ignore some dependencies of " << item << endl;
1961 MIL <<
"------------------------------------" << endl;
1965 resolverProblems.push_back (resolverProblem);
1968 return resolverProblems;
1973 { Resolver( _pool ).applySolutions( solutions ); }
1975 void SATResolver::setLocks()
1980 for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter != _items_to_lock.end(); ++iter) {
1982 if (iter->status().isInstalled()) {
1984 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
1985 queue_push( &(_jobQueue), ident );
1988 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
1989 queue_push( &(_jobQueue), ident );
1992 MIL <<
"Locked " << icnt <<
" installed items and " << acnt <<
" NOT installed items." << endl;
1998 std::set<IdString> unifiedByName;
1999 for (PoolItemList::const_iterator iter = _items_to_keep.begin(); iter != _items_to_keep.end(); ++iter) {
2000 IdString ident( (*iter)->satSolvable().ident() );
2001 if ( unifiedByName.insert( ident ).second )
2005 MIL <<
"Keep NOT installed name " << ident <<
" (" << *iter <<
")" << endl;
2006 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | SOLVER_WEAK |
MAYBE_CLEANDEPS );
2007 queue_push( &(_jobQueue), ident.id() );
2013 void SATResolver::setSystemRequirements()
2015 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
2016 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
2018 for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
2019 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
2020 queue_push( &(_jobQueue), iter->id() );
2021 MIL <<
"SYSTEM Requires " << *iter << endl;
2024 for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
2025 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
2026 queue_push( &(_jobQueue), iter->id() );
2027 MIL <<
"SYSTEM Conflicts " << *iter << endl;
2035 IdString rpm(
"rpm" );
2036 for_( it, pool.byIdentBegin(rpm), pool.byIdentEnd(rpm) )
2038 if ( (*it)->isSystem() )
2041 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
2042 queue_push( &(_jobQueue), archrule.id() );
2053 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
2061 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES );
2080 case SOLVER_RULE_DISTUPGRADE:
2081 ret =
str::form (
_(
"%s does not belong to a distupgrade repository"), s.asString().c_str());
2082 case SOLVER_RULE_INFARCH:
2083 ret =
str::form (
_(
"%s has inferior architecture"), s.asString().c_str());
2084 case SOLVER_RULE_UPDATE:
2085 ret =
str::form (
_(
"problem with installed package %s"), s.asString().c_str());
2086 case SOLVER_RULE_JOB:
2087 ret =
_(
"conflicting requests");
2088 case SOLVER_RULE_PKG:
2089 ret =
_(
"some dependency problem");
2090 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
2091 ret =
str::form (
_(
"nothing provides requested %s"), pool_dep2str(pool, dep));
2092 detail +=
_(
"Have you enabled all requested repositories?");
2093 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
2094 ret =
str::form (
_(
"package %s does not exist"), pool_dep2str(pool, dep));
2095 detail +=
_(
"Have you enabled all requested repositories?");
2096 case SOLVER_RULE_JOB_UNSUPPORTED:
2097 ret =
_(
"unsupported request");
2098 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
2099 ret =
str::form (
_(
"%s is provided by the system and cannot be erased"), pool_dep2str(pool, dep));
2100 case SOLVER_RULE_PKG_NOT_INSTALLABLE:
2101 ret =
str::form (
_(
"%s is not installable"), s.asString().c_str());
2102 case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
2104 ret =
str::form (
_(
"nothing provides %s needed by %s"), pool_dep2str(pool, dep), s.asString().c_str());
2105 case SOLVER_RULE_PKG_SAME_NAME:
2106 ret =
str::form (
_(
"cannot install both %s and %s"), s.asString().c_str(), s2.asString().c_str());
2107 case SOLVER_RULE_PKG_CONFLICTS:
2108 ret =
str::form (
_(
"%s conflicts with %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
2109 case SOLVER_RULE_PKG_OBSOLETES:
2110 ret =
str::form (
_(
"%s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
2111 case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
2112 ret =
str::form (
_(
"installed %s obsoletes %s provided by %s"), s.asString().c_str(), pool_dep2str(pool, dep), s2.asString().c_str());
2113 case SOLVER_RULE_PKG_SELF_CONFLICT:
2114 ret =
str::form (
_(
"solvable %s conflicts with %s provided by itself"), s.asString().c_str(), pool_dep2str(pool, dep));
2115 case SOLVER_RULE_PKG_REQUIRES: {
2116 ret =
str::form (
_(
"%s requires %s, but this requirement cannot be provided"), s.asString().c_str(), pool_dep2str(pool, dep));
2117 if (providerlistInstalled.size() > 0) {
2118 detail +=
_(
"deleted providers: ");
2119 detail +=
_(
"\nnot installable providers: ");
2120 detail =
_(
"not installable providers: ");
2123 if (p == SOLVER_SOLUTION_JOB) {
2124 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
2125 std::string description =
str::form (
_(
"remove lock to allow removal of %s"), s.asString().c_str() );
2126 std::string description =
str::form (
_(
"do not install %s"), s.asString().c_str());
2127 case SOLVER_ERASE | SOLVER_SOLVABLE: {
2128 std::string description =
str::form (
_(
"keep %s"), s.asString().c_str());
2129 std::string description =
str::form (
_(
"remove lock to allow installation of %s"),
itemToString( poolItem ).c_str());
2130 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
2131 std::string description =
str::form (
_(
"do not install %s"), ident.c_str() );
2132 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
2133 std::string description =
str::form (
_(
"keep %s"), ident.c_str());
2134 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
2135 resolverProblem->setDescription(
_(
"This request will break your system!"));
2136 description =
_(
"ignore the warning of a broken system");
2137 description =
str::form (
_(
"do not ask to install a solvable providing %s"), pool_dep2str(pool, what));
2138 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
2139 resolverProblem->setDescription(
_(
"This request will break your system!"));
2140 description =
_(
"ignore the warning of a broken system");
2141 description =
str::form (
_(
"do not ask to delete all solvables providing %s"), pool_dep2str(pool, what));
2142 case SOLVER_UPDATE | SOLVER_SOLVABLE:
2143 std::string description =
str::form (
_(
"do not install most recent version of %s"), s.asString().c_str());
2145 }
else if (p == SOLVER_SOLUTION_INFARCH) {
2146 std::string description =
str::form (
_(
"keep %s despite the inferior architecture"), s.asString().c_str());
2147 std::string description =
str::form (
_(
"install %s despite the inferior architecture"), s.asString().c_str());
2149 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
2150 std::string description =
str::form (
_(
"keep obsolete %s"), s.asString().c_str());
2151 std::string description =
str::form (
_(
"install %s from excluded repository"), s.asString().c_str());
2153 }
else if ( p == SOLVER_SOLUTION_BLACK ) {
2154 description = str::Format(
_(
"install %1% although it has been retracted")) % s.asString();
2155 description = str::Format(
_(
"allow to install the PTF %1%")) % s.asString();
2156 description = str::Format(
_(
"install %1% although it is blacklisted")) % s.asString();
2158 }
else if ( p > 0 ) {
2159 std::string description =
str::form (
_(
"downgrade of %s to %s"), s.asString().c_str(), sd.asString().c_str());
2160 std::string description =
str::form (
_(
"architecture change of %s to %s"), s.asString().c_str(), sd.asString().c_str());
2161 std::string description =
str::form (
_(
"install %s (with vendor change)\n %s --> %s") ,
2162 std::string description =
str::form (
_(
"replacement of %s with %s"), s.asString().c_str(), sd.asString().c_str());
2164 std::string description =
str::form (
_(
"deinstallation of %s"), s.asString().c_str());
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Access to the sat-pools string space.
Combining sat::Solvable and ResStatus.
ResStatus & status() const
Returns the current status.
sat::Solvable buddy() const
Return the buddy we share our status object with.
std::string alias() const
Short unique string to identify a repo.
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
static ResPool instance()
Singleton ctor.
static const ResStatus toBeInstalled
bool setToBeUninstalled(TransactByValue causer)
bool isToBeInstalled() const
bool setToBeInstalled(TransactByValue causer)
TransactValue getTransactValue() const
static const ResStatus toBeUninstalledDueToUpgrade
static const ResStatus toBeUninstalled
bool isToBeUninstalled() const
bool isToBeUninstalledDueToUpgrade() const
bool resetTransact(TransactByValue causer_r)
Not the same as setTransact( false ).
bool setToBeUninstalledDueToUpgrade(TransactByValue causer)
bool isUninstalled() const
bool equivalent(const Vendor &lVendor, const Vendor &rVendor) const
Return whether two vendor strings should be treated as the same vendor.
static const VendorAttr & instance()
(Pseudo)Singleton, mapped to the current Target::vendorAttr settings or to noTargetInstance.
static ZConfig & instance()
Singleton ctor.
static Pool instance()
Singleton ctor.
void prepare() const
Update housekeeping data if necessary (e.g.
detail::CPool * get() const
Expert backdoor.
Libsolv Id queue wrapper.
void push(value_type val_r)
Push a value to the end off the Queue.
A Solvable object within the sat Pool.
std::string asString() const
String representation "ident-edition.arch" or "noSolvable".
bool isSystem() const
Return whether this Solvable belongs to the system repo.
static const IdString ptfToken
Indicator provides ptf()
static const IdString retractedToken
Indicator provides retracted-patch-package()
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
Repository repository() const
The Repository this Solvable belongs to.
bool operator()(const PoolItem &item)
CheckIfUpdate(const sat::Solvable &installed_r)
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
std::ostream & dumpOn(std::ostream &str, const zypp::shared_ptr< void > &obj)
Chain< TACondition, TBCondition > chain(TACondition conda_r, TBCondition condb_r)
Convenience function for creating a Chain from two conditions conda_r and condb_r.
std::unary_function< PoolItem, bool > PoolItemFilterFunctor
std::unary_function< ResObject::constPtr, bool > ResObjectFilterFunctor
::s_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
int IdType
Generic Id type.
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
bool compareByNVR(const SolvableType< Derived > &lhs, const Solvable &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Queue SolvableQueue
Queue with Solvable ids.
Queue StringQueue
Queue with String ids.
bool sameNVRA(const SolvableType< Derived > &lhs, const Solvable &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static void SATSolutionToPool(PoolItem item, const ResStatus &status, const ResStatus::TransactByValue causer)
int vendorCheck(sat::detail::CPool *pool, Solvable *solvable1, Solvable *solvable2)
sat::Solvable mapBuddy(sat::Solvable item_r)
void establish(sat::Queue &pseudoItems_r, sat::Queue &pseudoFlags_r)
ResPool helper to compute the initial status of Patches etc.
IMPL_PTR_TYPE(SATResolver)
std::list< SolverQueueItem_Ptr > SolverQueueItemList
std::string itemToString(const PoolItem &item)
const std::string & asString(const std::string &t)
Global asString() that works with std::string too.
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
bool isPseudoInstalled(ResKind kind_r)
Those are denoted to be installed, if the solver verifies them as being satisfied.
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Capability > CapabilitySet
@ language
language support
ResolverFocus
The resolvers general attitude.
@ Update
Focus on updating requested packages and their dependencies as much as possible.
@ Default
Request the standard behavior (as defined in zypp.conf or 'Job')
@ Installed
Focus on applying as little changes to the installed packages as needed.
@ Job
Focus on installing the best version of the requested packages.
std::list< ResolverProblem_Ptr > ResolverProblemList
std::list< ProblemSolution_Ptr > ProblemSolutionList
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.
bool isKind(const ResKind &kind_r) const
Solvable satSolvable() const
Return the corresponding sat::Solvable.
std::string asString() const
bool multiversionInstall() const
bool operator()(PoolItem p)
FindPackage(ProblemSolutionCombi *p, const TransactionKind act)
ProblemSolutionCombi * problemSolution
Commit helper functor distributing PoolItem by status into lists.
PoolItemList & _items_to_lock
SATCollectTransact(PoolItemList &items_to_install_r, PoolItemList &items_to_remove_r, PoolItemList &items_to_lock_r, PoolItemList &items_to_keep_r, bool solveSrcPackages_r)
PoolItemList & _items_to_install
PoolItemList & _items_to_remove
PoolItemList & _items_to_keep
bool operator()(const PoolItem &item_r)