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 ( false )
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() );
479 invokeOnEach ( _pool.begin(), _pool.end(), std::ref( collector ) );
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.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() )
788 PoolItem poolItem( slv );
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 );
806 PoolItem poolItem( *it );
808 _pool.byIdentEnd( poolItem ),
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() ) {
845 PoolItem poolItem(*iter2);
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() ) {
855 PoolItem poolItem(*iter2);
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)) );
1020 _pool.byIdentEnd( poolItem ),
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 )
1102 std::vector<std::string> ret;
1103 sat::Queue problems;
1104 solver_findallproblemrules( _satSolver, problem, problems );
1110 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1111 if ( ruleClass != SolverRuleinfo::SOLVER_RULE_UPDATE && ruleClass != SolverRuleinfo::SOLVER_RULE_JOB ) {
1117 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1118 if ( nobad && ( ruleClass == SolverRuleinfo::SOLVER_RULE_UPDATE || ruleClass == SolverRuleinfo::SOLVER_RULE_JOB ) ) {
1124 std::string pInfo = SATproblemRuleInfoString( problems[i], detail, ignore );
1127 if ( std::find( ret.begin(), ret.end(), pInfo ) == ret.end() )
1128 ret.push_back( pInfo );
1133 std::string SATResolver::SATprobleminfoString(Id problem, std::string &detail, Id &ignoreId)
1137 Id probr = solver_findproblemrule(_satSolver, problem);
1138 return SATproblemRuleInfoString( probr, detail, ignoreId );
1141 std::string SATResolver::SATproblemRuleInfoString (Id probr, std::string &detail, Id &ignoreId)
1145 Id dep = 0, source = 0, target = 0;
1146 SolverRuleinfo type = solver_ruleinfo(_satSolver, probr, &source, &target, &dep);
1150 sat::Solvable s = mapSolvable( source );
1151 sat::Solvable s2 = mapSolvable( target );
1158 case SOLVER_RULE_DISTUPGRADE:
1160 ret = str::Format(
_(
"the installed %1% does not belong to a distupgrade repository and must be replaced") ) % s.asString();
1162 ret = str::Format(
_(
"the to be installed %1% does not belong to a distupgrade repository") ) % s.asString();
1164 case SOLVER_RULE_INFARCH:
1166 ret = str::Format(
_(
"the installed %1% has inferior architecture") ) % s.asString();
1168 ret = str::Format(
_(
"the to be installed %1% has inferior architecture") ) % s.asString();
1170 case SOLVER_RULE_UPDATE:
1171 ret = str::Format(
_(
"problem with the installed %1%") ) % s.asString();
1173 case SOLVER_RULE_JOB:
1174 ret =
_(
"conflicting requests");
1176 case SOLVER_RULE_PKG:
1177 ret =
_(
"some dependency problem");
1179 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1180 ret = str::Format(
_(
"nothing provides the requested '%1%'") ) % pool_dep2str(pool, dep);
1181 detail +=
_(
"Have you enabled all the required repositories?");
1183 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1184 ret = str::Format(
_(
"the requested package %1% does not exist") ) % pool_dep2str(pool, dep);
1185 detail +=
_(
"Have you enabled all the required repositories?");
1187 case SOLVER_RULE_JOB_UNSUPPORTED:
1188 ret =
_(
"unsupported request");
1190 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1191 ret = str::Format(
_(
"'%1%' is provided by the system and cannot be erased") ) % pool_dep2str(pool, dep);
1193 case SOLVER_RULE_PKG_NOT_INSTALLABLE:
1194 ret = str::Format(
_(
"%1% is not installable") ) % s.asString();
1196 case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
1199 ret = str::Format(
_(
"nothing provides '%1%' needed by the installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1201 ret = str::Format(
_(
"nothing provides '%1%' needed by the to be installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1203 case SOLVER_RULE_PKG_SAME_NAME:
1204 ret = str::Format(
_(
"cannot install both %1% and %2%") ) % s.asString() % s2.asString();
1206 case SOLVER_RULE_PKG_CONFLICTS:
1207 if ( s.isSystem() ) {
1208 if ( s2.isSystem() )
1209 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1211 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1214 if ( s2.isSystem() )
1215 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1217 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();
1220 case SOLVER_RULE_PKG_OBSOLETES:
1221 case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
1222 if ( s.isSystem() ) {
1223 if ( s2.isSystem() )
1224 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1226 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1229 if ( s2.isSystem() )
1230 ret = str::Format(
_(
"the to be installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1232 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();
1235 case SOLVER_RULE_PKG_SELF_CONFLICT:
1237 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1239 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1241 case SOLVER_RULE_PKG_REQUIRES: {
1243 Capability cap(dep);
1244 sat::WhatProvides possibleProviders(cap);
1247 typedef std::list<PoolItem> ProviderList;
1248 ProviderList providerlistInstalled, providerlistUninstalled;
1249 for_( iter1, possibleProviders.begin(), possibleProviders.end() ) {
1253 for_( iter2, possibleProviders.begin(), possibleProviders.end() ) {
1256 && ( (provider1.status().isInstalled() && provider2.status().isUninstalled())
1257 || (provider2.status().isInstalled() && provider1.status().isUninstalled()) )) {
1263 if (provider1.status().isInstalled())
1264 providerlistInstalled.push_back(provider1);
1266 providerlistUninstalled.push_back(provider1);
1271 ret = str::Format(
_(
"the installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1273 ret = str::Format(
_(
"the to be installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1274 if (providerlistInstalled.size() > 0) {
1275 detail +=
_(
"deleted providers: ");
1276 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1277 if (iter == providerlistInstalled.begin())
1283 if (providerlistUninstalled.size() > 0) {
1284 if (detail.size() > 0)
1285 detail +=
_(
"\nnot installable providers: ");
1287 detail =
_(
"not installable providers: ");
1288 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1289 if (iter == providerlistUninstalled.begin())
1298 DBG <<
"Unknown rule type(" << type <<
") going to query libsolv for rule information." << endl;
1299 ret =
str::asString( ::solver_problemruleinfo2str( _satSolver, type, static_cast<Id>(s.id()), static_cast<Id>(s2.id()), dep ) );
1311 void notInstallPatch( sat::Solvable slv_r )
1312 {
_patch.push_back( slv_r.ident() ); }
1314 void removePtf( sat::Solvable slv_r,
bool showremoveProtectHint_r =
false )
1317 bool applies()
const 1318 {
return not
_ptf.empty(); }
1320 std::string description()
const {
1321 if ( not
_patch.empty() ) {
1324 << (str::Format(
_(
"%1% is not yet fully integrated into %2%.") ) % printlist(
_ptf) % printlist(
_patch)) << endl
1325 <<
_(
"Typically you want to keep the PTF and choose to not install the maintenance patches.");
1330 const std::string & removeptfCommand { str::Format(
"zypper removeptf %1%") % printlist(
_ptf) };
1333 << (str::Format(
_(
"Removing the installed %1% in this context will remove (not replace!) the included PTF-packages too." ) ) % printlist(
_ptf)) << endl
1334 << (str::Format(
_(
"The PTF should be removed by calling '%1%'. This will update the included PTF-packages rather than removing them." ) ) % removeptfCommand) << endl
1335 <<
_(
"Typically you want to keep the PTF or choose to cancel the action.");
1340 << (str::Format(
_(
"The installed %1% blocks the desired action.") ) % printlist(
_ptf)) << endl
1341 <<
_(
"Typically you want to keep the PTF and choose to cancel the action.");
1345 static std::string printlist(
const std::vector<StoreType> & list_r )
1346 { str::Str ret;
dumpRange( ret.stream(), list_r.begin(), list_r.end(),
"",
"",
", ",
"",
"" );
return ret; }
1356 SATResolver::problems ()
1359 if (_satSolver && solver_problem_count(_satSolver)) {
1362 Id p = 0, rp = 0, what = 0;
1363 Id problem = 0, solution = 0, element = 0;
1364 sat::Solvable s, sd;
1366 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1367 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1369 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1372 while ((problem = solver_next_problem(_satSolver, problem)) != 0) {
1373 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1374 MIL <<
"====================================" << endl;
1377 std::string whatString = SATprobleminfoString (problem,detail,ignoreId);
1378 MIL << whatString << endl;
1379 MIL <<
"------------------------------------" << endl;
1380 ResolverProblem_Ptr resolverProblem =
new ResolverProblem (whatString, detail, SATgetCompleteProblemInfoStrings( problem ));
1381 PtfPatchHint ptfPatchHint;
1383 while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
1385 ProblemSolutionCombi *problemSolution =
new ProblemSolutionCombi;
1386 while ((element = solver_next_solutionelement(_satSolver, problem, solution, element, &p, &rp)) != 0) {
1387 if (p == SOLVER_SOLUTION_JOB) {
1389 what = _jobQueue.elements[rp];
1390 switch (_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1392 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1393 s = mapSolvable (what);
1394 PoolItem poolItem = _pool.find (s);
1396 if (pool->installed && s.get()->repo == pool->installed) {
1397 problemSolution->addSingleAction (poolItem, REMOVE);
1398 std::string description = str::Format(
_(
"remove lock to allow removal of %1%") ) % s.asString();
1399 MIL << description << endl;
1400 problemSolution->addDescription (description);
1401 if ( _protectPTFs && s.isPtfMaster() )
1402 ptfPatchHint.removePtf( s, _protectPTFs );
1404 problemSolution->addSingleAction (poolItem, KEEP);
1405 std::string description = str::Format(
_(
"do not install %1%") ) % s.asString();
1406 MIL << description << endl;
1407 problemSolution->addDescription (description);
1408 if ( s.isKind<Patch>() )
1409 ptfPatchHint.notInstallPatch( s );
1412 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.asString() << endl;
1416 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1417 s = mapSolvable (what);
1418 PoolItem poolItem = _pool.find (s);
1420 if (pool->installed && s.get()->repo == pool->installed) {
1421 problemSolution->addSingleAction (poolItem, KEEP);
1422 std::string description = str::Format(
_(
"keep %1%") ) % s.asString();
1423 MIL << description << endl;
1424 problemSolution->addDescription (description);
1426 problemSolution->addSingleAction (poolItem, UNLOCK);
1427 std::string description = str::Format(
_(
"remove lock to allow installation of %1%") ) %
itemToString( poolItem );
1428 MIL << description << endl;
1429 problemSolution->addDescription (description);
1432 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.asString() << endl;
1436 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1439 SolverQueueItemInstall_Ptr install =
1440 new SolverQueueItemInstall(_pool, ident.asString(), false );
1441 problemSolution->addSingleAction (install, REMOVE_SOLVE_QUEUE_ITEM);
1443 std::string description = str::Format(
_(
"do not install %1%") ) % ident;
1444 MIL << description << endl;
1445 problemSolution->addDescription (description);
1448 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1453 FindPackage info (problemSolution, KEEP);
1455 _pool.byIdentEnd( ident ),
1457 resfilter::ByTransact ()),
1460 SolverQueueItemDelete_Ptr del =
1461 new SolverQueueItemDelete(_pool, ident.asString(), false );
1462 problemSolution->addSingleAction (del, REMOVE_SOLVE_QUEUE_ITEM);
1464 std::string description = str::Format(
_(
"keep %1%") ) % ident;
1465 MIL << description << endl;
1466 problemSolution->addDescription (description);
1469 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1471 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_REQUIRE);
1472 std::string description =
"";
1475 if (system_requires.find(Capability(what)) != system_requires.end()) {
1477 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1478 resolverProblem->setDescription(
_(
"This request will break your system!"));
1479 description =
_(
"ignore the warning of a broken system");
1480 description += std::string(
" (requires:")+pool_dep2str(pool, what)+
")";
1481 MIL << description << endl;
1482 problemSolution->addFrontDescription (description);
1484 description = str::Format(
_(
"do not ask to install a solvable providing %1%") ) % pool_dep2str(pool, what);
1485 MIL << description << endl;
1486 problemSolution->addDescription (description);
1490 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1492 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_CONFLICT);
1493 std::string description =
"";
1496 if (system_conflicts.find(Capability(what)) != system_conflicts.end()) {
1498 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1499 resolverProblem->setDescription(
_(
"This request will break your system!"));
1500 description =
_(
"ignore the warning of a broken system");
1501 description += std::string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1502 MIL << description << endl;
1503 problemSolution->addFrontDescription (description);
1506 description = str::Format(
_(
"do not ask to delete all solvables providing %1%") ) % pool_dep2str(pool, what);
1507 MIL << description << endl;
1508 problemSolution->addDescription (description);
1512 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1514 s = mapSolvable (what);
1515 PoolItem poolItem = _pool.find (s);
1517 if (pool->installed && s.get()->repo == pool->installed) {
1518 problemSolution->addSingleAction (poolItem, KEEP);
1519 std::string description = str::Format(
_(
"do not install most recent version of %1%") ) % s.asString();
1520 MIL << description << endl;
1521 problemSolution->addDescription (description);
1523 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1526 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.asString() << endl;
1531 MIL <<
"- do something different" << endl;
1532 ERR <<
"No valid solution available" << endl;
1535 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1536 s = mapSolvable (rp);
1537 PoolItem poolItem = _pool.find (s);
1538 if (pool->installed && s.get()->repo == pool->installed) {
1539 problemSolution->addSingleAction (poolItem, LOCK);
1540 std::string description = str::Format(
_(
"keep %1% despite the inferior architecture") ) % s.asString();
1541 MIL << description << endl;
1542 problemSolution->addDescription (description);
1544 problemSolution->addSingleAction (poolItem, INSTALL);
1545 std::string description = str::Format(
_(
"install %1% despite the inferior architecture") ) % s.asString();
1546 MIL << description << endl;
1547 problemSolution->addDescription (description);
1549 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1550 s = mapSolvable (rp);
1551 PoolItem poolItem = _pool.find (s);
1552 if (pool->installed && s.get()->repo == pool->installed) {
1553 problemSolution->addSingleAction (poolItem, LOCK);
1554 std::string description = str::Format(
_(
"keep obsolete %1%") ) % s.asString();
1555 MIL << description << endl;
1556 problemSolution->addDescription (description);
1558 problemSolution->addSingleAction (poolItem, INSTALL);
1559 std::string description = str::Format(
_(
"install %1% from excluded repository") ) % s.asString();
1560 MIL << description << endl;
1561 problemSolution->addDescription (description);
1563 }
else if ( p == SOLVER_SOLUTION_BLACK ) {
1566 s = mapSolvable (rp);
1567 PoolItem poolItem = _pool.find (s);
1569 problemSolution->addSingleAction (poolItem, INSTALL);
1570 std::string description;
1571 if ( s.isRetracted() ) {
1573 description = str::Format(
_(
"install %1% although it has been retracted")) % s.asString();
1574 }
else if ( s.isPtf() ) {
1576 description = str::Format(
_(
"allow installing the PTF %1%")) % s.asString();
1579 description = str::Format(
_(
"install %1% although it is blacklisted")) % s.asString();
1581 MIL << description << endl;
1582 problemSolution->addDescription( description );
1583 }
else if ( p > 0 ) {
1585 s = mapSolvable (p);
1586 PoolItem itemFrom = _pool.find (s);
1591 sd = mapSolvable (rp);
1592 PoolItem itemTo = _pool.find (sd);
1593 if (itemFrom && itemTo) {
1594 problemSolution->addSingleAction (itemTo, INSTALL);
1595 int illegal = policy_is_illegal(_satSolver, s.get(), sd.get(), 0);
1597 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1599 std::string description = str::Format(
_(
"downgrade of %1% to %2%") ) % s.asString() % sd.asString();
1600 MIL << description << endl;
1601 problemSolution->addDescription (description);
1604 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1606 std::string description = str::Format(
_(
"architecture change of %1% to %2%") ) % s.asString() % sd.asString();
1607 MIL << description << endl;
1608 problemSolution->addDescription (description);
1611 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1615 std::string description;
1617 description = str::Format(
_(
"install %1% (with vendor change)\n %2% --> %3%") )
1619 % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " )
1620 % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " );
1622 description = str::Format(
_(
"install %1% from vendor %2%\n replacing %3% from vendor %4%") )
1623 % sd.asString() % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " )
1624 % s.asString() % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " );
1626 MIL << description << endl;
1627 problemSolution->addDescription (description);
1631 std::string description = str::Format(
_(
"replacement of %1% with %2%") ) % s.asString() % sd.asString();
1632 MIL << description << endl;
1633 problemSolution->addDescription (description);
1636 ERR << s.asString() <<
" or " << sd.asString() <<
" not found" << endl;
1642 std::string description = str::Format(
_(
"deinstallation of %1%") ) % s.asString();
1643 MIL << description << endl;
1644 problemSolution->addDescription (description);
1645 problemSolution->addSingleAction (itemFrom, REMOVE);
1646 if ( s.isPtfMaster() )
1647 ptfPatchHint.removePtf( s );
1653 INT <<
"Unknown solution " << p << endl;
1657 resolverProblem->addSolution (problemSolution,
1658 problemSolution->actionCount() > 1 ? true :
false);
1659 MIL <<
"------------------------------------" << endl;
1664 PoolItem item = _pool.find (sat::Solvable(ignoreId));
1665 ProblemSolutionIgnore *problemSolution =
new ProblemSolutionIgnore(item);
1666 resolverProblem->addSolution (problemSolution,
1668 MIL <<
"ignore some dependencies of " << item << endl;
1669 MIL <<
"------------------------------------" << endl;
1673 if ( ptfPatchHint.applies() ) {
1674 resolverProblem->setDescription( str::Str() << ptfPatchHint.description() << endl <<
"(" << resolverProblem->description() <<
")" );
1677 resolverProblems.push_back (resolverProblem);
1680 return resolverProblems;
1684 { Resolver( _pool ).applySolutions( solutions ); }
1690 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
1698 ::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
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
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.
bool sameNVRA(const SolvableType< Derived > &lhs, const Solvable &rhs)
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)
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
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
SATCollectTransact(PoolItemList &items_to_install_r, PoolItemList &items_to_remove_r, PoolItemList &items_to_lock_r, PoolItemList &items_to_keep_r, bool solveSrcPackages_r)
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
bool compareByNVR(const SolvableType< Derived > &lhs, const Solvable &rhs)
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
std::list< ProblemSolution_Ptr > ProblemSolutionList
static ResPool instance()
Singleton ctor.