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 59 #define XDEBUG(x) do { if (base::logger::isExcessive()) XXX << x << std::endl;} while (0) 61 #undef ZYPP_BASE_LOGGER_LOGGROUP 62 #define ZYPP_BASE_LOGGER_LOGGROUP "zypp::solver" 83 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
84 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
87 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 1 );
88 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
91 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
92 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 1 );
100 inline sat::Queue collectPseudoInstalled(
const ResPool & pool_r )
103 for (
const PoolItem & pi : pool_r )
111 inline void solverCopyBackWeak(
sat::detail::CSolver & satSolver_r, PoolItemList & orphanedItems_r )
115 sat::Queue recommendations;
116 sat::Queue suggestions;
117 ::solver_get_recommendations( &satSolver_r, recommendations, suggestions, 0 );
119 PoolItem(sat::Solvable(recommendations[i])).status().setRecommended(
true );
121 PoolItem(sat::Solvable(suggestions[i])).status().setSuggested(
true );
124 orphanedItems_r.clear();
126 ::solver_get_orphaned( &satSolver_r, orphaned );
129 PoolItem pi { sat::Solvable(orphaned[i]) };
130 pi.status().setOrphaned(
true );
131 orphanedItems_r.push_back( pi );
136 ::solver_get_unneeded( &satSolver_r, unneeded, 1 );
138 PoolItem(sat::Solvable(unneeded[i])).status().setUnneeded(
true );
143 inline void solverCopyBackValidate(
sat::detail::CSolver & satSolver_r,
const ResPool & pool_r )
145 sat::Queue pseudoItems { collectPseudoInstalled( pool_r ) };
146 if ( ! pseudoItems.empty() )
148 sat::Queue pseudoFlags;
149 ::solver_trivial_installable( &satSolver_r, pseudoItems, pseudoFlags );
153 PoolItem pi { sat::Solvable(pseudoItems[i]) };
154 switch ( pseudoFlags[i] )
156 case 0: pi.status().setBroken();
break;
157 case 1: pi.status().setSatisfied();
break;
158 case -1: pi.status().setNonRelevant();
break;
159 default: pi.status().setUndetermined();
break;
172 #define MAYBE_CLEANDEPS (cleandepsOnRemove()?SOLVER_CLEANDEPS:0) 191 if ( ! pseudoItems_r.
empty() )
194 MIL <<
"Establish..." << endl;
196 ::pool_set_custom_vendorcheck( cPool, &
vendorCheck );
202 jobQueue.
push( SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
203 jobQueue.
push( solv.id() );
208 if ( ::solver_solve( cSolver, jobQueue ) != 0 )
209 INT <<
"How can establish fail?" << endl;
211 ::solver_trivial_installable( cSolver, pseudoItems_r, pseudoFlags_r );
216 switch ( pseudoFlags_r[i] )
218 case 0: pi.status().setBroken();
break;
219 case 1: pi.status().setSatisfied();
break;
220 case -1: pi.status().setNonRelevant();
break;
221 default: pi.status().setUndetermined();
break;
224 MIL <<
"Establish DONE" << endl;
227 MIL <<
"Establish not needed." << endl;
233 return std::string();
236 std::string ret( slv.asString() );
237 if ( ! slv.isSystem() )
251 os <<
"<resolver>" << endl;
253 #define OUTS(X) os << " " << #X << "\t= " << solver_get_flag(_satSolver, SOLVER_FLAG_##X) << endl 254 OUTS( ALLOW_DOWNGRADE );
255 OUTS( ALLOW_ARCHCHANGE );
256 OUTS( ALLOW_VENDORCHANGE );
257 OUTS( ALLOW_NAMECHANGE );
258 OUTS( ALLOW_UNINSTALL );
259 OUTS( NO_UPDATEPROVIDE );
260 OUTS( SPLITPROVIDES );
261 OUTS( ONLY_NAMESPACE_RECOMMENDED );
262 OUTS( ADD_ALREADY_RECOMMENDED );
263 OUTS( NO_INFARCHCHECK );
264 OUTS( KEEP_EXPLICIT_OBSOLETES );
265 OUTS( BEST_OBEY_POLICY );
266 OUTS( NO_AUTOTARGET );
267 OUTS( DUP_ALLOW_DOWNGRADE );
268 OUTS( DUP_ALLOW_ARCHCHANGE );
269 OUTS( DUP_ALLOW_VENDORCHANGE );
270 OUTS( DUP_ALLOW_NAMECHANGE );
271 OUTS( KEEP_ORPHANS );
272 OUTS( BREAK_ORPHANS );
273 OUTS( YUM_OBSOLETES );
275 os <<
" focus = " << _focus << endl;
276 os <<
" distupgrade = " << _distupgrade << endl;
277 os <<
" removeOrphaned = " << _removeOrphaned << endl;
278 os <<
" solveSrcPackages = " << _solveSrcPackages << endl;
279 os <<
" cleandepsOnRemove = " << _cleandepsOnRemove << endl;
280 os <<
" fixsystem = " << _fixsystem << endl;
284 return os <<
"<resolver/>" << endl;
291 : _pool(
std::move(pool))
294 , _focus ( ZConfig::instance().solver_focus() )
296 , _allowdowngrade ( false )
297 , _allownamechange ( true )
298 , _allowarchchange ( false )
299 , _allowvendorchange ( ZConfig::instance().solver_allowVendorChange() )
300 , _allowuninstall ( false )
301 , _updatesystem ( false )
302 , _noUpdateProvide ( ZConfig::instance().solver_noUpdateProvide() )
303 , _dosplitprovides ( true )
304 , _onlyRequires (ZConfig::instance().solver_onlyRequires())
305 , _ignorealreadyrecommended(true)
306 , _distupgrade(false)
307 , _removeOrphaned(false)
308 , _removeUnneeded(false)
309 , _dup_allowdowngrade ( ZConfig::instance().solver_dupAllowDowngrade() )
310 , _dup_allownamechange ( ZConfig::instance().solver_dupAllowNameChange() )
311 , _dup_allowarchchange ( ZConfig::instance().solver_dupAllowArchChange() )
312 , _dup_allowvendorchange ( ZConfig::instance().solver_dupAllowVendorChange() )
313 , _solveSrcPackages(false)
314 , _cleandepsOnRemove(ZConfig::instance().solver_cleandepsOnRemove())
319 SATResolver::~SATResolver()
327 SATResolver::pool (
void)
const 349 XDEBUG(
"SATSolutionToPool install returns " << item <<
", " << r);
353 XDEBUG(
"SATSolutionToPool upgrade returns " << item <<
", " << r);
357 XDEBUG(
"SATSolutionToPool remove returns " << item <<
", " << r);
378 PoolItemList & items_to_remove_r,
379 PoolItemList & items_to_lock_r,
380 PoolItemList & items_to_keep_r,
381 bool solveSrcPackages_r )
382 : _items_to_install( items_to_install_r )
383 , _items_to_remove( items_to_remove_r )
384 , _items_to_lock( items_to_lock_r )
385 , _items_to_keep( items_to_keep_r )
386 , _solveSrcPackages( solveSrcPackages_r )
388 _items_to_install.clear();
389 _items_to_remove.clear();
390 _items_to_lock.clear();
391 _items_to_keep.clear();
398 bool by_solver = ( itemStatus.isBySolver() || itemStatus.isByApplLow() );
413 switch ( itemStatus.getTransactValue() )
416 itemStatus.isUninstalled() ? _items_to_install.push_back( item_r )
417 : _items_to_remove.push_back( item_r );
break;
435 SATResolver::solverEnd()
440 solver_free(_satSolver);
442 queue_free( &(_jobQueue) );
447 SATResolver::solverInit(
const PoolItemList & weakItems)
449 MIL <<
"SATResolver::solverInit()" << endl;
453 _satSolver = solver_create( _satPool );
454 queue_init( &_jobQueue );
459 bool toRelax =
false;
460 if ( _distupgrade ) {
462 if ( ! solv.isSystem() ) {
463 MIL <<
"Relaxed vendor check requested by " << solv << endl;
473 ::pool_add_userinstalled_jobs(_satPool,
sat::Pool::instance().autoInstalled(), &(_jobQueue), GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED);
478 SATCollectTransact
collector( _items_to_install, _items_to_remove, _items_to_lock, _items_to_keep, solveSrcPackages() );
483 for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
486 ERR <<
"Weaken: " << *iter <<
" not found" << endl;
488 MIL <<
"Weaken dependencies of " << *iter << endl;
489 queue_push( &(_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
490 queue_push( &(_jobQueue),
id );
495 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
497 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
504 const auto & trackedLocaleIds( myPool().trackedLocaleIds() );
507 for (
const auto & locale : trackedLocaleIds.added() )
509 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
513 for (
const auto & locale : trackedLocaleIds.removed() )
515 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES | SOLVER_CLEANDEPS );
521 for (
const sat::Solvable & solv : myPool().multiversionList() )
523 queue_push( &(_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
524 queue_push( &(_jobQueue), solv.id() );
533 if ( _protectPTFs ) {
534 for (
const auto & solv : sat::AllPTFs() ) {
535 if ( solv.isSystem() ) {
536 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
537 queue_push( &(_jobQueue), solv.id() );
544 solverInitSetSystemRequirements();
547 solverInitSetLocks();
550 solverInitSetModeJobsAndFlags();
553 void SATResolver::solverInitSetSystemRequirements()
555 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
556 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
558 for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
559 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
560 queue_push( &(_jobQueue), iter->id() );
561 MIL <<
"SYSTEM Requires " << *iter << endl;
564 for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
565 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
566 queue_push( &(_jobQueue), iter->id() );
567 MIL <<
"SYSTEM Conflicts " << *iter << endl;
576 for_( it, pool.byIdentBegin(rpm), pool.byIdentEnd(rpm) )
578 if ( (*it)->isSystem() )
581 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
582 queue_push( &(_jobQueue), archrule.id() );
589 void SATResolver::solverInitSetLocks()
594 for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter != _items_to_lock.end(); ++iter) {
596 if (iter->status().isInstalled()) {
598 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
599 queue_push( &(_jobQueue),
id );
602 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
603 queue_push( &(_jobQueue),
id );
606 MIL <<
"Locked " << icnt <<
" installed items and " << acnt <<
" NOT installed items." << endl;
612 std::set<IdString> unifiedByName;
613 for (PoolItemList::const_iterator iter = _items_to_keep.begin(); iter != _items_to_keep.end(); ++iter) {
615 if ( unifiedByName.insert( ident ).second )
619 MIL <<
"Keep NOT installed name " << ident <<
" (" << *iter <<
")" << endl;
620 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | SOLVER_WEAK |
MAYBE_CLEANDEPS );
621 queue_push( &(_jobQueue), ident.id() );
627 void SATResolver::solverInitSetModeJobsAndFlags()
630 queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
631 queue_push( &(_jobQueue), 0 );
634 queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
635 queue_push( &(_jobQueue), 0 );
638 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
639 queue_push( &(_jobQueue), 0 );
644 if (_removeOrphaned) {
645 queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
646 queue_push( &(_jobQueue), 0 );
649 if (_removeUnneeded) {
650 invokeOnEach ( _pool.begin(), _pool.end(), [
this](
const PoolItem & pi_r ) {
651 if ( pi_r.status().isUnneeded() ) {
652 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | SOLVER_WEAK |
MAYBE_CLEANDEPS );
653 queue_push( &(_jobQueue), pi_r.ident().id() );
659 solverSetFocus( *_satSolver, _focus );
660 solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
661 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
662 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
663 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
664 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange);
665 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
666 solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noUpdateProvide);
667 solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
668 solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED,
false);
669 solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires);
670 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade );
671 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange );
672 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange );
673 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, _dup_allowvendorchange );
689 : is_updated( false )
690 , _installed( installed_r )
717 MIL <<
"Starting solving...." << endl;
719 if ( solver_solve( _satSolver, &(_jobQueue) ) == 0 )
726 if ( _removeOrphaned )
727 MIL <<
"Droplist processing not needed. RemoveUnsupported is On." << endl;
729 MIL <<
"Droplist processing is disabled in ZConfig." << endl;
732 bool resolve =
false;
733 MIL <<
"Checking droplists ..." << endl;
736 solver_get_decisionqueue( _satSolver, decisionq );
743 static const Capability productCap {
"product()" };
744 if ( slv && slv.dep_provides().matches( productCap ) )
746 CapabilitySet droplist { slv.valuesOfNamespace(
"weakremover" ) };
747 MIL <<
"Droplist for " << slv <<
": size " << droplist.size() << endl;
748 if ( !droplist.empty() )
750 for (
const auto & cap : droplist )
752 queue_push( &_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
753 queue_push( &_jobQueue, cap.id() );
756 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
757 queue_push( &(_jobQueue),
id );
763 solver_solve( _satSolver, &(_jobQueue) );
767 MIL <<
"....Solver end" << endl;
771 _result_items_to_install.clear();
772 _result_items_to_remove.clear();
776 queue_init(&decisionq);
777 solver_get_decisionqueue(_satSolver, &decisionq);
778 for (
int i = 0; i < decisionq.count; ++i )
780 Id p = decisionq.elements[i];
785 if ( ! slv || slv.isSystem() )
790 _result_items_to_install.push_back(
poolItem );
792 queue_free(&decisionq);
796 if ( systemRepo && ! systemRepo.solvablesEmpty() )
798 bool mustCheckObsoletes =
false;
799 for_( it, systemRepo.solvablesBegin(), systemRepo.solvablesEnd() )
801 if (solver_get_decisionlevel(_satSolver, it->id()) > 0)
805 CheckIfUpdate info( *it );
809 resfilter::ByUninstalled(),
812 if (info.is_updated) {
816 if ( ! mustCheckObsoletes )
817 mustCheckObsoletes =
true;
819 _result_items_to_remove.push_back (
poolItem);
821 if ( mustCheckObsoletes )
823 sat::WhatObsoletes obsoleted( _result_items_to_install.begin(), _result_items_to_install.end() );
824 for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
826 ResStatus & status( it->status() );
828 if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
829 status.setToBeUninstalledDueToObsolete();
836 solverCopyBackWeak( *_satSolver, _problem_items );
837 solverCopyBackValidate( *_satSolver, _pool );
842 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
843 sat::WhatProvides rpmProviders(*iter);
844 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
846 if (
poolItem.status().isToBeInstalled()) {
847 MIL <<
"User requirement " << *iter <<
" sets " <<
poolItem << endl;
852 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
853 sat::WhatProvides rpmProviders(*iter);
854 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
856 if (
poolItem.status().isToBeUninstalled()) {
857 MIL <<
"User conflict " << *iter <<
" sets " <<
poolItem << endl;
863 if (solver_problem_count(_satSolver) > 0 )
865 ERR <<
"Solverrun finished with an ERROR" << endl;
872 void SATResolver::solverAddJobsFromPool()
874 for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
877 ERR <<
"Install: " << *iter <<
" not found" << endl;
879 MIL <<
"Install " << *iter << endl;
880 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
881 queue_push( &(_jobQueue),
id );
885 for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
888 ERR <<
"Delete: " << *iter <<
" not found" << endl;
890 MIL <<
"Delete " << *iter << endl;
891 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
892 queue_push( &(_jobQueue),
id);
899 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
900 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
901 queue_push( &(_jobQueue), iter->id() );
902 MIL <<
"Requires " << *iter << endl;
905 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
906 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
907 queue_push( &(_jobQueue), iter->id() );
908 MIL <<
"Conflicts " << *iter << endl;
913 SATResolver::resolvePool(
const CapabilitySet & requires_caps,
915 const PoolItemList & weakItems,
916 const std::set<Repository> & upgradeRepos)
918 MIL <<
"SATResolver::resolvePool()" << endl;
921 solverInit(weakItems);
924 solverAddJobsFromPool();
925 solverAddJobsFromExtraQueues( requires_caps, conflict_caps );
927 for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
929 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
930 queue_push( &(_jobQueue), iter->get()->repoid );
931 MIL <<
"Upgrade repo " << *iter << endl;
935 bool ret = solving(requires_caps, conflict_caps);
937 (ret?
MIL:
WAR) <<
"SATResolver::resolvePool() done. Ret:" << ret << endl;
944 const PoolItemList & weakItems)
946 MIL <<
"SATResolver::resolvQueue()" << endl;
949 solverInit(weakItems);
952 for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
953 (*iter)->addRule(_jobQueue);
957 solverAddJobsFromPool();
960 bool ret = solving();
962 (ret?
MIL:
WAR) <<
"SATResolver::resolveQueue() done. Ret:" << ret << endl;
967 void SATResolver::doUpdate()
969 MIL <<
"SATResolver::doUpdate()" << endl;
972 solverInit(PoolItemList());
982 MIL <<
"Starting solving for update...." << endl;
984 solver_solve( _satSolver, &(_jobQueue) );
985 MIL <<
"....Solver end" << endl;
992 queue_init(&decisionq);
993 solver_get_decisionqueue(_satSolver, &decisionq);
994 for (
int i = 0; i < decisionq.count; i++)
996 Id p = decisionq.elements[i];
1001 if ( ! solv || solv.isSystem() )
1006 queue_free(&decisionq);
1009 if ( _satSolver->pool->installed ) {
1010 for (
int i = _satSolver->pool->installed->start; i < _satSolver->pool->installed->start + _satSolver->pool->installed->nsolvables; i++)
1012 if (solver_get_decisionlevel(_satSolver, i) > 0)
1015 PoolItem
poolItem( _pool.find( sat::Solvable(i) ) );
1018 CheckIfUpdate info( (sat::Solvable(i)) );
1021 resfilter::ByUninstalled(),
1024 if (info.is_updated) {
1030 ERR <<
"id " << i <<
" not found in ZYPP pool." << endl;
1037 solverCopyBackWeak( *_satSolver, _problem_items );
1038 solverCopyBackValidate( *_satSolver, _pool );
1040 MIL <<
"SATResolver::doUpdate() done" << endl;
1060 : problemSolution (p)
1067 problemSolution->addSingleAction (p, action);
1100 std::vector<std::string> SATResolver::SATgetCompleteProblemInfoStrings ( Id problem, std::string & detail_r, Id & ignoreId_r )
1102 std::vector<std::string> ret;
1103 sat::Queue problems;
1104 solver_findallproblemrules( _satSolver, problem, problems );
1108 Id probr = solver_findproblemrule( _satSolver, problem );
1109 ret.push_back( SATproblemRuleInfoString( probr, detail_r, ignoreId_r ) );
1116 if ( problems[i] == probr )
1118 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1119 if ( ruleClass != SolverRuleinfo::SOLVER_RULE_UPDATE && ruleClass != SolverRuleinfo::SOLVER_RULE_JOB ) {
1125 if ( problems[i] == probr )
1127 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1128 if ( nobad && ( ruleClass == SolverRuleinfo::SOLVER_RULE_UPDATE || ruleClass == SolverRuleinfo::SOLVER_RULE_JOB ) ) {
1134 std::string pInfo = SATproblemRuleInfoString( problems[i], detail, ignore );
1137 if ( std::find( ret.begin(), ret.end(), pInfo ) == ret.end() )
1138 ret.push_back( pInfo );
1143 std::string SATResolver::SATproblemRuleInfoString (Id probr, std::string &detail, Id &ignoreId)
1147 Id dep = 0, source = 0, target = 0;
1148 SolverRuleinfo type = solver_ruleinfo(_satSolver, probr, &source, &target, &dep);
1152 sat::Solvable s = mapSolvable( source );
1153 sat::Solvable s2 = mapSolvable( target );
1160 case SOLVER_RULE_DISTUPGRADE:
1162 ret = str::Format(
_(
"the installed %1% does not belong to a distupgrade repository and must be replaced") ) % s.asString();
1164 ret = str::Format(
_(
"the to be installed %1% does not belong to a distupgrade repository") ) % s.asString();
1166 case SOLVER_RULE_INFARCH:
1168 ret = str::Format(
_(
"the installed %1% has inferior architecture") ) % s.asString();
1170 ret = str::Format(
_(
"the to be installed %1% has inferior architecture") ) % s.asString();
1172 case SOLVER_RULE_UPDATE:
1173 ret = str::Format(
_(
"problem with the installed %1%") ) % s.asString();
1175 case SOLVER_RULE_JOB:
1176 ret =
_(
"conflicting requests");
1178 case SOLVER_RULE_PKG:
1179 ret =
_(
"some dependency problem");
1181 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1182 ret = str::Format(
_(
"nothing provides the requested '%1%'") ) % pool_dep2str(pool, dep);
1183 detail +=
_(
"Have you enabled all the required repositories?");
1185 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1186 ret = str::Format(
_(
"the requested package %1% does not exist") ) % pool_dep2str(pool, dep);
1187 detail +=
_(
"Have you enabled all the required repositories?");
1189 case SOLVER_RULE_JOB_UNSUPPORTED:
1190 ret =
_(
"unsupported request");
1192 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1193 ret = str::Format(
_(
"'%1%' is provided by the system and cannot be erased") ) % pool_dep2str(pool, dep);
1195 case SOLVER_RULE_PKG_NOT_INSTALLABLE:
1196 ret = str::Format(
_(
"%1% is not installable") ) % s.asString();
1198 case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
1201 ret = str::Format(
_(
"nothing provides '%1%' needed by the installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1203 ret = str::Format(
_(
"nothing provides '%1%' needed by the to be installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1205 case SOLVER_RULE_PKG_SAME_NAME:
1206 ret = str::Format(
_(
"cannot install both %1% and %2%") ) % s.asString() % s2.asString();
1208 case SOLVER_RULE_PKG_CONFLICTS:
1209 if ( s.isSystem() ) {
1210 if ( s2.isSystem() )
1211 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1213 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1216 if ( s2.isSystem() )
1217 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1219 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();
1222 case SOLVER_RULE_PKG_OBSOLETES:
1223 case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
1224 if ( s.isSystem() ) {
1225 if ( s2.isSystem() )
1226 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1228 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1231 if ( s2.isSystem() )
1232 ret = str::Format(
_(
"the to be installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1234 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();
1237 case SOLVER_RULE_PKG_SELF_CONFLICT:
1239 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1241 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1243 case SOLVER_RULE_PKG_REQUIRES: {
1245 Capability cap(dep);
1246 sat::WhatProvides possibleProviders(cap);
1249 typedef std::list<PoolItem> ProviderList;
1250 ProviderList providerlistInstalled, providerlistUninstalled;
1251 for_( iter1, possibleProviders.begin(), possibleProviders.end() ) {
1255 for_( iter2, possibleProviders.begin(), possibleProviders.end() ) {
1258 && ( (provider1.status().isInstalled() && provider2.status().isUninstalled())
1259 || (provider2.status().isInstalled() && provider1.status().isUninstalled()) )) {
1265 if (provider1.status().isInstalled())
1266 providerlistInstalled.push_back(provider1);
1268 providerlistUninstalled.push_back(provider1);
1273 ret = str::Format(
_(
"the installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1275 ret = str::Format(
_(
"the to be installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1276 if (providerlistInstalled.size() > 0) {
1277 detail +=
_(
"deleted providers: ");
1278 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1279 if (iter == providerlistInstalled.begin())
1285 if (providerlistUninstalled.size() > 0) {
1286 if (detail.size() > 0)
1287 detail +=
_(
"\nnot installable providers: ");
1289 detail =
_(
"not installable providers: ");
1290 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1291 if (iter == providerlistUninstalled.begin())
1300 DBG <<
"Unknown rule type(" << type <<
") going to query libsolv for rule information." << endl;
1301 ret =
str::asString( ::solver_problemruleinfo2str( _satSolver, type, static_cast<Id>(s.id()), static_cast<Id>(s2.id()), dep ) );
1313 void notInstallPatch( sat::Solvable slv_r )
1314 {
_patch.push_back( slv_r.ident() ); }
1316 void removePtf( sat::Solvable slv_r,
bool showremoveProtectHint_r =
false )
1319 bool applies()
const 1320 {
return not
_ptf.empty(); }
1322 std::string description()
const {
1323 if ( not
_patch.empty() ) {
1326 << (str::Format(
_(
"%1% is not yet fully integrated into %2%.") ) % printlist(
_ptf) % printlist(
_patch)) << endl
1327 <<
_(
"Typically you want to keep the PTF and choose to not install the maintenance patches.");
1332 const std::string & removeptfCommand { str::Format(
"zypper removeptf %1%") % printlist(
_ptf) };
1335 << (str::Format(
_(
"Removing the installed %1% in this context will remove (not replace!) the included PTF-packages too." ) ) % printlist(
_ptf)) << endl
1336 << (str::Format(
_(
"The PTF should be removed by calling '%1%'. This will update the included PTF-packages rather than removing them." ) ) % removeptfCommand) << endl
1337 <<
_(
"Typically you want to keep the PTF or choose to cancel the action.");
1342 << (str::Format(
_(
"The installed %1% blocks the desired action.") ) % printlist(
_ptf)) << endl
1343 <<
_(
"Typically you want to keep the PTF and choose to cancel the action.");
1347 static std::string printlist(
const std::vector<StoreType> & list_r )
1348 { str::Str ret;
dumpRange( ret.stream(), list_r.begin(), list_r.end(),
"",
"",
", ",
"",
"" );
return ret; }
1358 SATResolver::problems ()
1361 if (_satSolver && solver_problem_count(_satSolver)) {
1364 Id p = 0, rp = 0, what = 0;
1365 Id problem = 0, solution = 0, element = 0;
1366 sat::Solvable s, sd;
1368 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1369 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1371 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1374 while ((problem = solver_next_problem(_satSolver, problem)) != 0) {
1375 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1376 MIL <<
"====================================" << endl;
1378 ResolverProblem_Ptr resolverProblem;
1381 std::vector<std::string> allWhatStrings = SATgetCompleteProblemInfoStrings( problem, detail, ignoreId );
1382 std::string whatString = allWhatStrings[0];
1383 for (
const auto & problemString : allWhatStrings )
1384 MIL <<
"- " << problemString << endl;
1385 MIL <<
"------------------------------------" << endl;
1386 resolverProblem =
new ResolverProblem( std::move(whatString), std::move(detail), std::move(allWhatStrings) );
1388 PtfPatchHint ptfPatchHint;
1390 while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
1392 ProblemSolutionCombi *problemSolution =
new ProblemSolutionCombi;
1393 while ((element = solver_next_solutionelement(_satSolver, problem, solution, element, &p, &rp)) != 0) {
1394 if (p == SOLVER_SOLUTION_JOB) {
1396 what = _jobQueue.elements[rp];
1397 switch (_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1399 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1400 s = mapSolvable (what);
1401 PoolItem
poolItem = _pool.find (s);
1403 if (pool->installed && s.get()->repo == pool->installed) {
1404 problemSolution->addSingleAction (
poolItem, REMOVE);
1405 std::string description = str::Format(
_(
"remove lock to allow removal of %1%") ) % s.asString();
1406 MIL << description << endl;
1407 problemSolution->addDescription (description);
1408 if ( _protectPTFs && s.isPtfMaster() )
1409 ptfPatchHint.removePtf( s, _protectPTFs );
1411 problemSolution->addSingleAction (
poolItem, KEEP);
1412 std::string description = str::Format(
_(
"do not install %1%") ) % s.asString();
1413 MIL << description << endl;
1414 problemSolution->addDescription (description);
1415 if ( s.isKind<Patch>() )
1416 ptfPatchHint.notInstallPatch( s );
1419 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.asString() << endl;
1423 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1424 s = mapSolvable (what);
1425 PoolItem
poolItem = _pool.find (s);
1427 if (pool->installed && s.get()->repo == pool->installed) {
1428 problemSolution->addSingleAction (
poolItem, KEEP);
1429 std::string description = str::Format(
_(
"keep %1%") ) % s.asString();
1430 MIL << description << endl;
1431 problemSolution->addDescription (description);
1433 problemSolution->addSingleAction (
poolItem, UNLOCK);
1434 std::string description = str::Format(
_(
"remove lock to allow installation of %1%") ) %
itemToString(
poolItem );
1435 MIL << description << endl;
1436 problemSolution->addDescription (description);
1439 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.asString() << endl;
1443 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1446 SolverQueueItemInstall_Ptr install =
1447 new SolverQueueItemInstall(_pool, ident.asString(), false );
1448 problemSolution->addSingleAction (install, REMOVE_SOLVE_QUEUE_ITEM);
1450 std::string description = str::Format(
_(
"do not install %1%") ) % ident;
1451 MIL << description << endl;
1452 problemSolution->addDescription (description);
1455 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1460 FindPackage info (problemSolution, KEEP);
1462 _pool.byIdentEnd( ident ),
1464 resfilter::ByTransact ()),
1467 SolverQueueItemDelete_Ptr del =
1468 new SolverQueueItemDelete(_pool, ident.asString(), false );
1469 problemSolution->addSingleAction (del, REMOVE_SOLVE_QUEUE_ITEM);
1471 std::string description = str::Format(
_(
"keep %1%") ) % ident;
1472 MIL << description << endl;
1473 problemSolution->addDescription (description);
1476 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1478 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_REQUIRE);
1479 std::string description =
"";
1482 if (system_requires.find(Capability(what)) != system_requires.end()) {
1484 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1485 resolverProblem->setDescription(
_(
"This request will break your system!"));
1486 description =
_(
"ignore the warning of a broken system");
1487 description += std::string(
" (requires:")+pool_dep2str(pool, what)+
")";
1488 MIL << description << endl;
1489 problemSolution->addFrontDescription (description);
1491 description = str::Format(
_(
"do not ask to install a solvable providing %1%") ) % pool_dep2str(pool, what);
1492 MIL << description << endl;
1493 problemSolution->addDescription (description);
1497 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1499 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_CONFLICT);
1500 std::string description =
"";
1503 if (system_conflicts.find(Capability(what)) != system_conflicts.end()) {
1505 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1506 resolverProblem->setDescription(
_(
"This request will break your system!"));
1507 description =
_(
"ignore the warning of a broken system");
1508 description += std::string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1509 MIL << description << endl;
1510 problemSolution->addFrontDescription (description);
1513 description = str::Format(
_(
"do not ask to delete all solvables providing %1%") ) % pool_dep2str(pool, what);
1514 MIL << description << endl;
1515 problemSolution->addDescription (description);
1519 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1521 s = mapSolvable (what);
1522 PoolItem
poolItem = _pool.find (s);
1524 if (pool->installed && s.get()->repo == pool->installed) {
1525 problemSolution->addSingleAction (
poolItem, KEEP);
1526 std::string description = str::Format(
_(
"do not install most recent version of %1%") ) % s.asString();
1527 MIL << description << endl;
1528 problemSolution->addDescription (description);
1530 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " <<
poolItem <<
" is not selected for installation" << endl;
1533 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.asString() << endl;
1538 MIL <<
"- do something different" << endl;
1539 ERR <<
"No valid solution available" << endl;
1542 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1543 s = mapSolvable (rp);
1544 PoolItem
poolItem = _pool.find (s);
1545 if (pool->installed && s.get()->repo == pool->installed) {
1546 problemSolution->addSingleAction (
poolItem, LOCK);
1547 std::string description = str::Format(
_(
"keep %1% despite the inferior architecture") ) % s.asString();
1548 MIL << description << endl;
1549 problemSolution->addDescription (description);
1551 problemSolution->addSingleAction (
poolItem, INSTALL);
1552 std::string description = str::Format(
_(
"install %1% despite the inferior architecture") ) % s.asString();
1553 MIL << description << endl;
1554 problemSolution->addDescription (description);
1556 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1557 s = mapSolvable (rp);
1558 PoolItem
poolItem = _pool.find (s);
1559 if (pool->installed && s.get()->repo == pool->installed) {
1560 problemSolution->addSingleAction (
poolItem, LOCK);
1561 std::string description = str::Format(
_(
"keep obsolete %1%") ) % s.asString();
1562 MIL << description << endl;
1563 problemSolution->addDescription (description);
1565 problemSolution->addSingleAction (
poolItem, INSTALL);
1566 std::string description = str::Format(
_(
"install %1% from excluded repository") ) % s.asString();
1567 MIL << description << endl;
1568 problemSolution->addDescription (description);
1570 }
else if ( p == SOLVER_SOLUTION_BLACK ) {
1573 s = mapSolvable (rp);
1574 PoolItem
poolItem = _pool.find (s);
1576 problemSolution->addSingleAction (
poolItem, INSTALL);
1577 std::string description;
1578 if ( s.isRetracted() ) {
1580 description = str::Format(
_(
"install %1% although it has been retracted")) % s.asString();
1581 }
else if ( s.isPtf() ) {
1583 description = str::Format(
_(
"allow installing the PTF %1%")) % s.asString();
1586 description = str::Format(
_(
"install %1% although it is blacklisted")) % s.asString();
1588 MIL << description << endl;
1589 problemSolution->addDescription( description );
1590 }
else if ( p > 0 ) {
1592 s = mapSolvable (p);
1593 PoolItem itemFrom = _pool.find (s);
1598 sd = mapSolvable (rp);
1599 PoolItem itemTo = _pool.find (sd);
1600 if (itemFrom && itemTo) {
1601 problemSolution->addSingleAction (itemTo, INSTALL);
1602 int illegal = policy_is_illegal(_satSolver, s.get(), sd.get(), 0);
1604 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1606 std::string description = str::Format(
_(
"downgrade of %1% to %2%") ) % s.asString() % sd.asString();
1607 MIL << description << endl;
1608 problemSolution->addDescription (description);
1611 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1613 std::string description = str::Format(
_(
"architecture change of %1% to %2%") ) % s.asString() % sd.asString();
1614 MIL << description << endl;
1615 problemSolution->addDescription (description);
1618 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1622 std::string description;
1624 description = str::Format(
_(
"install %1% (with vendor change)\n %2% --> %3%") )
1626 % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " )
1627 % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " );
1629 description = str::Format(
_(
"install %1% from vendor %2%\n replacing %3% from vendor %4%") )
1630 % sd.asString() % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " )
1631 % s.asString() % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " );
1633 MIL << description << endl;
1634 problemSolution->addDescription (description);
1638 std::string description = str::Format(
_(
"replacement of %1% with %2%") ) % s.asString() % sd.asString();
1639 MIL << description << endl;
1640 problemSolution->addDescription (description);
1643 ERR << s.asString() <<
" or " << sd.asString() <<
" not found" << endl;
1649 std::string description = str::Format(
_(
"deinstallation of %1%") ) % s.asString();
1650 MIL << description << endl;
1651 problemSolution->addDescription (description);
1652 problemSolution->addSingleAction (itemFrom, REMOVE);
1653 if ( s.isPtfMaster() )
1654 ptfPatchHint.removePtf( s );
1660 INT <<
"Unknown solution " << p << endl;
1664 resolverProblem->addSolution (problemSolution,
1665 problemSolution->actionCount() > 1 ? true :
false);
1666 MIL <<
"------------------------------------" << endl;
1671 PoolItem item = _pool.find (sat::Solvable(ignoreId));
1672 ProblemSolutionIgnore *problemSolution =
new ProblemSolutionIgnore(item);
1673 resolverProblem->addSolution (problemSolution,
1675 MIL <<
"ignore some dependencies of " << item << endl;
1676 MIL <<
"------------------------------------" << endl;
1680 if ( ptfPatchHint.applies() ) {
1681 resolverProblem->setDescription( str::Str() << ptfPatchHint.description() << endl <<
"(" << resolverProblem->description() <<
")" );
1684 resolverProblems.push_back (resolverProblem);
1687 return resolverProblems;
1691 { Resolver( _pool ).applySolutions( solutions ); }
1697 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
1705 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES );
static const IdString ptfMasterToken
Indicator provides ptf()
A Solvable object within the sat Pool.
Container of Solvable providing a Capability (read only).
bool operator()(const PoolItem &p)
PoolItemList & _items_to_remove
Focus on updating requested packages and their dependencies as much as possible.
::s_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
static ZConfig & instance()
Singleton ctor.
bool isToBeInstalled() const
bool equivalent(const Vendor &lVendor, const Vendor &rVendor) const
Return whether two vendor strings should be treated as the same vendor.
Queue StringQueue
Queue with String ids.
ProblemSolutionCombi * problemSolution
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
ResolverFocus
The resolver's general attitude.
bool _showremoveProtectHint
std::ostream & dumpRange(std::ostream &str, TIterator begin, TIterator end, const std::string &intro="{", const std::string &pfx="\ ", const std::string &sep="\ ", const std::string &sfx="\, const std::string &extro="}")
Print range defined by iterators (multiline style).
ResStatus & status() const
Returns the current status.
static const ResStatus toBeInstalled
Collector< TOutputIterator > collector(TOutputIterator iter_r)
relates: Collector Convenience constructor.
sat::Solvable buddy() const
Return the buddy we share our status object with.
const std::string & asString(const std::string &t)
Global asString() that works with std::string too.
int IdType
Generic Id type.
Access to the sat-pools string space.
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
Request the standard behavior (as defined in zypp.conf or 'Job')
bool resetTransact(TransactByValue causer_r)
Not the same as setTransact( false ).
size_type reposSize() const
Number of repos in Pool.
static void SATSolutionToPool(const PoolItem &item, const ResStatus &status, const ResStatus::TransactByValue causer)
bool setToBeUninstalledDueToUpgrade(TransactByValue causer)
std::vector< StoreType > _patch
static const ResStatus toBeUninstalledDueToUpgrade
void prepare() const
Update housekeeping data if necessary (e.g.
CheckIfUpdate(const sat::Solvable &installed_r)
Repository repository() const
The Repository this Solvable belongs to.
void push(value_type val_r)
Push a value to the end off the Queue.
void establish(sat::Queue &pseudoItems_r, sat::Queue &pseudoFlags_r)
ResPool helper to compute the initial status of Patches etc.
static Pool instance()
Singleton ctor.
Commit helper functor distributing PoolItem by status into lists.
bool operator()(const PoolItem &item)
int relaxedVendorCheck(sat::detail::CPool *pool, Solvable *solvable1, Solvable *solvable2)
int vendorCheck(sat::detail::CPool *pool, Solvable *solvable1, Solvable *solvable2)
bool sameNVRA(const Solvable &lhs, const Solvable &rhs)
relates: Solvable Test for same name version release and arch.
Focus on applying as little changes to the installed packages as needed.
bool multiversionInstall() const
bool relaxedEquivalent(const Vendor &lVendor, const Vendor &rVendor) const
Like equivalent but always unifies suse and openSUSE vendor.
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)
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
relates: Capability Detailed stream output
bool operator()(const PoolItem &item_r)
std::list< SolverQueueItem_Ptr > SolverQueueItemList
bool setToBeUninstalled(TransactByValue causer)
FindPackage(ProblemSolutionCombi *p, const TransactionKind act)
std::unordered_set< Capability > CapabilitySet
Libsolv Id queue wrapper.
PoolItemList & _items_to_keep
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
sat::Solvable mapBuddy(sat::Solvable item_r)
PoolItemList & _items_to_install
std::string alias() const
Short unique string to identify a repo.
std::list< ResolverProblem_Ptr > ResolverProblemList
bool isToBeUninstalled() const
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Chain< TACondition, TBCondition > chain(TACondition conda_r, TBCondition condb_r)
Convenience function for creating a Chain from two conditions conda_r and condb_r.
bool setToBeInstalled(TransactByValue causer)
bool isPseudoInstalled(const ResKind &kind_r)
Those are denoted to be installed, if the solver verifies them as being satisfied.
IMPL_PTR_TYPE(SATResolver)
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
Combining sat::Solvable and ResStatus.
Pathname systemRoot() const
The target root directory.
static const IdString retractedToken
Indicator provides retracted-patch-package()
std::string asString() const
Conversion to std::string
bool isKind(const ResKind &kind_r) const
static const VendorAttr & instance()
(Pseudo)Singleton, mapped to the current Target::vendorAttr settings or to noTargetInstance.
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.
std::string itemToString(const PoolItem &item)
Easy-to use interface to the ZYPP dependency resolver.
Solvable satSolvable() const
Return the corresponding sat::Solvable.
Focus on installing the best version of the requested packages.
static const ResStatus toBeUninstalled
std::vector< StoreType > _ptf
bool isToBeUninstalledDueToUpgrade() const
int compareByNVR(const Resolvable::constPtr &lhs, const Resolvable::constPtr &rhs)
relates: Resolvable Compare according to kind, name and edition.
std::list< ProblemSolution_Ptr > ProblemSolutionList
static ResPool instance()
Singleton ctor.