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 34 #include <zypp/base/LogTools.h> 35 #include <zypp/base/Gettext.h> 40 #include <zypp/AutoDispose.h> 43 #include <zypp/sat/detail/PoolImpl.h> 45 #include <zypp/solver/detail/Resolver.h> 57 #define XDEBUG(x) do { if (base::logger::isExcessive()) XXX << x << std::endl;} while (0) 59 #undef ZYPP_BASE_LOGGER_LOGGROUP 60 #define ZYPP_BASE_LOGGER_LOGGROUP "zypp::solver" 81 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
82 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
85 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 1 );
86 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
89 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
90 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 1 );
98 inline sat::Queue collectPseudoInstalled(
const ResPool & pool_r )
101 for (
const PoolItem & pi : pool_r )
109 inline void solverCopyBackWeak(
sat::detail::CSolver & satSolver_r, PoolItemList & orphanedItems_r )
113 sat::Queue recommendations;
114 sat::Queue suggestions;
115 ::solver_get_recommendations( &satSolver_r, recommendations, suggestions, 0 );
117 PoolItem(sat::Solvable(recommendations[i])).status().setRecommended(
true );
119 PoolItem(sat::Solvable(suggestions[i])).status().setSuggested(
true );
122 orphanedItems_r.clear();
124 ::solver_get_orphaned( &satSolver_r, orphaned );
127 PoolItem pi { sat::Solvable(orphaned[i]) };
128 pi.status().setOrphaned(
true );
129 orphanedItems_r.push_back( pi );
134 ::solver_get_unneeded( &satSolver_r, unneeded, 1 );
136 PoolItem(sat::Solvable(unneeded[i])).status().setUnneeded(
true );
141 inline void solverCopyBackValidate(
sat::detail::CSolver & satSolver_r,
const ResPool & pool_r )
143 sat::Queue pseudoItems { collectPseudoInstalled( pool_r ) };
144 if ( ! pseudoItems.empty() )
146 sat::Queue pseudoFlags;
147 ::solver_trivial_installable( &satSolver_r, pseudoItems, pseudoFlags );
151 PoolItem pi { sat::Solvable(pseudoItems[i]) };
152 switch ( pseudoFlags[i] )
154 case 0: pi.status().setBroken();
break;
155 case 1: pi.status().setSatisfied();
break;
156 case -1: pi.status().setNonRelevant();
break;
157 default: pi.status().setUndetermined();
break;
170 #define MAYBE_CLEANDEPS (cleandepsOnRemove()?SOLVER_CLEANDEPS:0) 189 if ( ! pseudoItems_r.
empty() )
191 MIL <<
"Establish..." << endl;
193 ::pool_set_custom_vendorcheck( cPool, &
vendorCheck );
199 jobQueue.
push( SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
200 jobQueue.
push( solv.id() );
205 if ( ::solver_solve( cSolver, jobQueue ) != 0 )
206 INT <<
"How can establish fail?" << endl;
208 ::solver_trivial_installable( cSolver, pseudoItems_r, pseudoFlags_r );
213 switch ( pseudoFlags_r[i] )
215 case 0: pi.status().setBroken();
break;
216 case 1: pi.status().setSatisfied();
break;
217 case -1: pi.status().setNonRelevant();
break;
218 default: pi.status().setUndetermined();
break;
221 MIL <<
"Establish DONE" << endl;
224 MIL <<
"Establish not needed." << endl;
230 return std::string();
233 std::string ret( slv.asString() );
234 if ( ! slv.isSystem() )
248 os <<
"<resolver>" << endl;
250 #define OUTS(X) os << " " << #X << "\t= " << solver_get_flag(_satSolver, SOLVER_FLAG_##X) << endl 251 OUTS( ALLOW_DOWNGRADE );
252 OUTS( ALLOW_ARCHCHANGE );
253 OUTS( ALLOW_VENDORCHANGE );
254 OUTS( ALLOW_NAMECHANGE );
255 OUTS( ALLOW_UNINSTALL );
256 OUTS( NO_UPDATEPROVIDE );
257 OUTS( SPLITPROVIDES );
258 OUTS( ONLY_NAMESPACE_RECOMMENDED );
259 OUTS( ADD_ALREADY_RECOMMENDED );
260 OUTS( NO_INFARCHCHECK );
261 OUTS( KEEP_EXPLICIT_OBSOLETES );
262 OUTS( BEST_OBEY_POLICY );
263 OUTS( NO_AUTOTARGET );
264 OUTS( DUP_ALLOW_DOWNGRADE );
265 OUTS( DUP_ALLOW_ARCHCHANGE );
266 OUTS( DUP_ALLOW_VENDORCHANGE );
267 OUTS( DUP_ALLOW_NAMECHANGE );
268 OUTS( KEEP_ORPHANS );
269 OUTS( BREAK_ORPHANS );
270 OUTS( YUM_OBSOLETES );
272 os <<
" focus = " << _focus << endl;
273 os <<
" distupgrade = " << _distupgrade << endl;
274 os <<
" distupgrade_removeunsupported = " << _distupgrade_removeunsupported << endl;
275 os <<
" solveSrcPackages = " << _solveSrcPackages << endl;
276 os <<
" cleandepsOnRemove = " << _cleandepsOnRemove << endl;
277 os <<
" fixsystem = " << _fixsystem << endl;
281 return os <<
"<resolver/>" << endl;
291 , _focus ( ZConfig::instance().solver_focus() )
293 , _allowdowngrade ( false )
294 , _allownamechange ( true )
295 , _allowarchchange ( false )
296 , _allowvendorchange ( ZConfig::instance().solver_allowVendorChange() )
297 , _allowuninstall ( false )
298 , _updatesystem(false)
299 , _noupdateprovide ( false )
300 , _dosplitprovides ( true )
301 , _onlyRequires (ZConfig::instance().solver_onlyRequires())
302 , _ignorealreadyrecommended(true)
303 , _distupgrade(false)
304 , _distupgrade_removeunsupported(false)
305 , _dup_allowdowngrade ( ZConfig::instance().solver_dupAllowDowngrade() )
306 , _dup_allownamechange ( ZConfig::instance().solver_dupAllowNameChange() )
307 , _dup_allowarchchange ( ZConfig::instance().solver_dupAllowArchChange() )
308 , _dup_allowvendorchange ( ZConfig::instance().solver_dupAllowVendorChange() )
309 , _solveSrcPackages(false)
310 , _cleandepsOnRemove(ZConfig::instance().solver_cleandepsOnRemove())
315 SATResolver::~SATResolver()
323 SATResolver::pool (
void)
const 345 XDEBUG(
"SATSolutionToPool install returns " << item <<
", " << r);
349 XDEBUG(
"SATSolutionToPool upgrade returns " << item <<
", " << r);
353 XDEBUG(
"SATSolutionToPool remove returns " << item <<
", " << r);
374 PoolItemList & items_to_remove_r,
375 PoolItemList & items_to_lock_r,
376 PoolItemList & items_to_keep_r,
377 bool solveSrcPackages_r )
378 : _items_to_install( items_to_install_r )
379 , _items_to_remove( items_to_remove_r )
380 , _items_to_lock( items_to_lock_r )
381 , _items_to_keep( items_to_keep_r )
382 , _solveSrcPackages( solveSrcPackages_r )
384 _items_to_install.clear();
385 _items_to_remove.clear();
386 _items_to_lock.clear();
387 _items_to_keep.clear();
394 bool by_solver = ( itemStatus.isBySolver() || itemStatus.isByApplLow() );
409 switch ( itemStatus.getTransactValue() )
412 itemStatus.isUninstalled() ? _items_to_install.push_back( item_r )
413 : _items_to_remove.push_back( item_r );
break;
431 SATResolver::solverEnd()
436 solver_free(_satSolver);
438 queue_free( &(_jobQueue) );
443 SATResolver::solverInit(
const PoolItemList & weakItems)
445 MIL <<
"SATResolver::solverInit()" << endl;
449 _satSolver = solver_create( _satPool );
450 queue_init( &_jobQueue );
455 bool toRelax =
false;
456 if ( _distupgrade ) {
458 if ( ! solv.isSystem() ) {
459 MIL <<
"Relaxed vendor check requested by " << solv << endl;
469 ::pool_add_userinstalled_jobs(_satPool,
sat::Pool::instance().autoInstalled(), &(_jobQueue), GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED);
474 SATCollectTransact collector( _items_to_install, _items_to_remove, _items_to_lock, _items_to_keep, solveSrcPackages() );
475 invokeOnEach ( _pool.begin(), _pool.end(), std::ref( collector ) );
479 for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
482 ERR <<
"Weaken: " << *iter <<
" not found" << endl;
484 MIL <<
"Weaken dependencies of " << *iter << endl;
485 queue_push( &(_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
486 queue_push( &(_jobQueue),
id );
491 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
493 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
500 const auto & trackedLocaleIds( myPool().trackedLocaleIds() );
503 for (
const auto & locale : trackedLocaleIds.added() )
505 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
509 for (
const auto & locale : trackedLocaleIds.removed() )
511 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES | SOLVER_CLEANDEPS );
517 for (
const sat::Solvable & solv : myPool().multiversionList() )
519 queue_push( &(_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
520 queue_push( &(_jobQueue), solv.id() );
529 if ( _protectPTFs ) {
530 for (
const auto & solv : sat::AllPTFs() ) {
531 if ( solv.isSystem() ) {
532 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
533 queue_push( &(_jobQueue), solv.id() );
540 solverInitSetSystemRequirements();
543 solverInitSetLocks();
546 solverInitSetModeJobsAndFlags();
549 void SATResolver::solverInitSetSystemRequirements()
551 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
552 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
554 for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
555 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
556 queue_push( &(_jobQueue), iter->id() );
557 MIL <<
"SYSTEM Requires " << *iter << endl;
560 for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
561 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
562 queue_push( &(_jobQueue), iter->id() );
563 MIL <<
"SYSTEM Conflicts " << *iter << endl;
571 IdString rpm(
"rpm" );
572 for_( it, pool.byIdentBegin(rpm), pool.byIdentEnd(rpm) )
574 if ( (*it)->isSystem() )
577 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
578 queue_push( &(_jobQueue), archrule.id() );
585 void SATResolver::solverInitSetLocks()
590 for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter != _items_to_lock.end(); ++iter) {
592 if (iter->status().isInstalled()) {
594 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
595 queue_push( &(_jobQueue),
id );
598 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
599 queue_push( &(_jobQueue),
id );
602 MIL <<
"Locked " << icnt <<
" installed items and " << acnt <<
" NOT installed items." << endl;
608 std::set<IdString> unifiedByName;
609 for (PoolItemList::const_iterator iter = _items_to_keep.begin(); iter != _items_to_keep.end(); ++iter) {
610 IdString ident( iter->ident() );
611 if ( unifiedByName.insert( ident ).second )
615 MIL <<
"Keep NOT installed name " << ident <<
" (" << *iter <<
")" << endl;
616 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | SOLVER_WEAK |
MAYBE_CLEANDEPS );
617 queue_push( &(_jobQueue), ident.id() );
623 void SATResolver::solverInitSetModeJobsAndFlags()
626 queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
627 queue_push( &(_jobQueue), 0 );
630 queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
631 queue_push( &(_jobQueue), 0 );
634 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
635 queue_push( &(_jobQueue), 0 );
637 if (_distupgrade_removeunsupported) {
638 queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
639 queue_push( &(_jobQueue), 0 );
642 solverSetFocus( *_satSolver, _focus );
643 solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
644 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
645 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
646 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
647 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange);
648 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
649 solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide);
650 solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
651 solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED,
false);
652 solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires);
653 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade );
654 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange );
655 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange );
656 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, _dup_allowvendorchange );
672 : is_updated( false )
673 , _installed( installed_r )
700 MIL <<
"Starting solving...." << endl;
702 if ( solver_solve( _satSolver, &(_jobQueue) ) == 0 )
709 if ( _distupgrade_removeunsupported )
710 MIL <<
"Droplist processing not needed. RemoveUnsupported is On." << endl;
712 MIL <<
"Droplist processing is disabled in ZConfig." << endl;
715 bool resolve =
false;
716 MIL <<
"Checking droplists ..." << endl;
719 solver_get_decisionqueue( _satSolver, decisionq );
726 static const Capability productCap {
"product()" };
727 if ( slv && slv.provides().matches( productCap ) )
729 CapabilitySet droplist { slv.valuesOfNamespace(
"weakremover" ) };
730 MIL <<
"Droplist for " << slv <<
": size " << droplist.size() << endl;
731 if ( !droplist.empty() )
733 for (
const auto & cap : droplist )
735 queue_push( &_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
736 queue_push( &_jobQueue, cap.id() );
739 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
740 queue_push( &(_jobQueue),
id );
746 solver_solve( _satSolver, &(_jobQueue) );
750 MIL <<
"....Solver end" << endl;
754 _result_items_to_install.clear();
755 _result_items_to_remove.clear();
759 queue_init(&decisionq);
760 solver_get_decisionqueue(_satSolver, &decisionq);
761 for (
int i = 0; i < decisionq.count; ++i )
763 Id p = decisionq.elements[i];
768 if ( ! slv || slv.isSystem() )
771 PoolItem poolItem( slv );
773 _result_items_to_install.push_back( poolItem );
775 queue_free(&decisionq);
779 if ( systemRepo && ! systemRepo.solvablesEmpty() )
781 bool mustCheckObsoletes =
false;
782 for_( it, systemRepo.solvablesBegin(), systemRepo.solvablesEnd() )
784 if (solver_get_decisionlevel(_satSolver, it->id()) > 0)
788 CheckIfUpdate info( *it );
789 PoolItem poolItem( *it );
791 _pool.byIdentEnd( poolItem ),
792 resfilter::ByUninstalled(),
795 if (info.is_updated) {
799 if ( ! mustCheckObsoletes )
800 mustCheckObsoletes =
true;
802 _result_items_to_remove.push_back (poolItem);
804 if ( mustCheckObsoletes )
806 sat::WhatObsoletes obsoleted( _result_items_to_install.begin(), _result_items_to_install.end() );
807 for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
809 ResStatus & status( it->status() );
811 if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
812 status.setToBeUninstalledDueToObsolete();
819 solverCopyBackWeak( *_satSolver, _problem_items );
820 solverCopyBackValidate( *_satSolver, _pool );
825 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
826 sat::WhatProvides rpmProviders(*iter);
827 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
828 PoolItem poolItem(*iter2);
829 if (poolItem.status().isToBeInstalled()) {
830 MIL <<
"User requirement " << *iter <<
" sets " << poolItem << endl;
835 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
836 sat::WhatProvides rpmProviders(*iter);
837 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
838 PoolItem poolItem(*iter2);
839 if (poolItem.status().isToBeUninstalled()) {
840 MIL <<
"User conflict " << *iter <<
" sets " << poolItem << endl;
846 if (solver_problem_count(_satSolver) > 0 )
848 ERR <<
"Solverrun finished with an ERROR" << endl;
855 void SATResolver::solverAddJobsFromPool()
857 for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
860 ERR <<
"Install: " << *iter <<
" not found" << endl;
862 MIL <<
"Install " << *iter << endl;
863 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
864 queue_push( &(_jobQueue),
id );
868 for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
871 ERR <<
"Delete: " << *iter <<
" not found" << endl;
873 MIL <<
"Delete " << *iter << endl;
874 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
875 queue_push( &(_jobQueue),
id);
882 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
883 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
884 queue_push( &(_jobQueue), iter->id() );
885 MIL <<
"Requires " << *iter << endl;
888 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
889 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
890 queue_push( &(_jobQueue), iter->id() );
891 MIL <<
"Conflicts " << *iter << endl;
896 SATResolver::resolvePool(
const CapabilitySet & requires_caps,
898 const PoolItemList & weakItems,
899 const std::set<Repository> & upgradeRepos)
901 MIL <<
"SATResolver::resolvePool()" << endl;
904 solverInit(weakItems);
907 solverAddJobsFromPool();
908 solverAddJobsFromExtraQueues( requires_caps, conflict_caps );
910 for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
912 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
913 queue_push( &(_jobQueue), iter->get()->repoid );
914 MIL <<
"Upgrade repo " << *iter << endl;
918 bool ret = solving(requires_caps, conflict_caps);
920 (ret?
MIL:
WAR) <<
"SATResolver::resolvePool() done. Ret:" << ret << endl;
927 const PoolItemList & weakItems)
929 MIL <<
"SATResolver::resolvQueue()" << endl;
932 solverInit(weakItems);
935 for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
936 (*iter)->addRule(_jobQueue);
940 solverAddJobsFromPool();
943 bool ret = solving();
945 (ret?
MIL:
WAR) <<
"SATResolver::resolveQueue() done. Ret:" << ret << endl;
950 void SATResolver::doUpdate()
952 MIL <<
"SATResolver::doUpdate()" << endl;
955 solverInit(PoolItemList());
965 MIL <<
"Starting solving for update...." << endl;
967 solver_solve( _satSolver, &(_jobQueue) );
968 MIL <<
"....Solver end" << endl;
975 queue_init(&decisionq);
976 solver_get_decisionqueue(_satSolver, &decisionq);
977 for (
int i = 0; i < decisionq.count; i++)
979 Id p = decisionq.elements[i];
984 if ( ! solv || solv.isSystem() )
989 queue_free(&decisionq);
992 if ( _satSolver->pool->installed ) {
993 for (
int i = _satSolver->pool->installed->start; i < _satSolver->pool->installed->start + _satSolver->pool->installed->nsolvables; i++)
995 if (solver_get_decisionlevel(_satSolver, i) > 0)
998 PoolItem poolItem( _pool.find( sat::Solvable(i) ) );
1001 CheckIfUpdate info( (sat::Solvable(i)) );
1003 _pool.byIdentEnd( poolItem ),
1004 resfilter::ByUninstalled(),
1007 if (info.is_updated) {
1013 ERR <<
"id " << i <<
" not found in ZYPP pool." << endl;
1020 solverCopyBackWeak( *_satSolver, _problem_items );
1021 solverCopyBackValidate( *_satSolver, _pool );
1023 MIL <<
"SATResolver::doUpdate() done" << endl;
1043 : problemSolution (p)
1050 problemSolution->addSingleAction (p, action);
1083 std::vector<std::string> SATResolver::SATgetCompleteProblemInfoStrings ( Id problem )
1085 std::vector<std::string> ret;
1086 sat::Queue problems;
1087 solver_findallproblemrules( _satSolver, problem, problems );
1093 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1094 if ( ruleClass != SolverRuleinfo::SOLVER_RULE_UPDATE && ruleClass != SolverRuleinfo::SOLVER_RULE_JOB ) {
1100 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1101 if ( nobad && ( ruleClass == SolverRuleinfo::SOLVER_RULE_UPDATE || ruleClass == SolverRuleinfo::SOLVER_RULE_JOB ) ) {
1107 std::string pInfo = SATproblemRuleInfoString( problems[i], detail, ignore );
1110 if ( std::find( ret.begin(), ret.end(), pInfo ) == ret.end() )
1111 ret.push_back( pInfo );
1116 std::string SATResolver::SATprobleminfoString(Id problem, std::string &detail, Id &ignoreId)
1120 Id probr = solver_findproblemrule(_satSolver, problem);
1121 return SATproblemRuleInfoString( probr, detail, ignoreId );
1124 std::string SATResolver::SATproblemRuleInfoString (Id probr, std::string &detail, Id &ignoreId)
1128 Id dep, source, target;
1129 SolverRuleinfo type = solver_ruleinfo(_satSolver, probr, &source, &target, &dep);
1133 sat::Solvable s = mapSolvable( source );
1134 sat::Solvable s2 = mapSolvable( target );
1141 case SOLVER_RULE_DISTUPGRADE:
1143 ret = str::Format(
_(
"the installed %1% does not belong to a distupgrade repository and must be replaced") ) % s.asString();
1145 ret = str::Format(
_(
"the to be installed %1% does not belong to a distupgrade repository") ) % s.asString();
1147 case SOLVER_RULE_INFARCH:
1149 ret = str::Format(
_(
"the installed %1% has inferior architecture") ) % s.asString();
1151 ret = str::Format(
_(
"the to be installed %1% has inferior architecture") ) % s.asString();
1153 case SOLVER_RULE_UPDATE:
1154 ret = str::Format(
_(
"problem with the installed %1%") ) % s.asString();
1156 case SOLVER_RULE_JOB:
1157 ret =
_(
"conflicting requests");
1159 case SOLVER_RULE_PKG:
1160 ret =
_(
"some dependency problem");
1162 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1163 ret = str::Format(
_(
"nothing provides the requested '%1%'") ) % pool_dep2str(pool, dep);
1164 detail +=
_(
"Have you enabled all the required repositories?");
1166 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1167 ret = str::Format(
_(
"the requested package %1% does not exist") ) % pool_dep2str(pool, dep);
1168 detail +=
_(
"Have you enabled all the required repositories?");
1170 case SOLVER_RULE_JOB_UNSUPPORTED:
1171 ret =
_(
"unsupported request");
1173 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1174 ret = str::Format(
_(
"'%1%' is provided by the system and cannot be erased") ) % pool_dep2str(pool, dep);
1176 case SOLVER_RULE_PKG_NOT_INSTALLABLE:
1177 ret = str::Format(
_(
"%1% is not installable") ) % s.asString();
1179 case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
1182 ret = str::Format(
_(
"nothing provides '%1%' needed by the installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1184 ret = str::Format(
_(
"nothing provides '%1%' needed by the to be installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1186 case SOLVER_RULE_PKG_SAME_NAME:
1187 ret = str::Format(
_(
"cannot install both %1% and %2%") ) % s.asString() % s2.asString();
1189 case SOLVER_RULE_PKG_CONFLICTS:
1190 if ( s.isSystem() ) {
1191 if ( s2.isSystem() )
1192 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1194 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1197 if ( s2.isSystem() )
1198 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1200 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();
1203 case SOLVER_RULE_PKG_OBSOLETES:
1204 case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
1205 if ( s.isSystem() ) {
1206 if ( s2.isSystem() )
1207 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1209 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1212 if ( s2.isSystem() )
1213 ret = str::Format(
_(
"the to be installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1215 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();
1218 case SOLVER_RULE_PKG_SELF_CONFLICT:
1220 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1222 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1224 case SOLVER_RULE_PKG_REQUIRES: {
1226 Capability cap(dep);
1227 sat::WhatProvides possibleProviders(cap);
1230 typedef std::list<PoolItem> ProviderList;
1231 ProviderList providerlistInstalled, providerlistUninstalled;
1232 for_( iter1, possibleProviders.begin(), possibleProviders.end() ) {
1236 for_( iter2, possibleProviders.begin(), possibleProviders.end() ) {
1239 && ( (provider1.status().isInstalled() && provider2.status().isUninstalled())
1240 || (provider2.status().isInstalled() && provider1.status().isUninstalled()) )) {
1246 if (provider1.status().isInstalled())
1247 providerlistInstalled.push_back(provider1);
1249 providerlistUninstalled.push_back(provider1);
1254 ret = str::Format(
_(
"the installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1256 ret = str::Format(
_(
"the to be installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1257 if (providerlistInstalled.size() > 0) {
1258 detail +=
_(
"deleted providers: ");
1259 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1260 if (iter == providerlistInstalled.begin())
1266 if (providerlistUninstalled.size() > 0) {
1267 if (detail.size() > 0)
1268 detail +=
_(
"\nnot installable providers: ");
1270 detail =
_(
"not installable providers: ");
1271 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1272 if (iter == providerlistUninstalled.begin())
1281 DBG <<
"Unknown rule type(" << type <<
") going to query libsolv for rule information." << endl;
1282 ret =
str::asString( ::solver_problemruleinfo2str( _satSolver, type, static_cast<Id>(s.id()), static_cast<Id>(s2.id()), dep ) );
1294 void notInstallPatch( sat::Solvable slv_r )
1295 {
_patch.push_back( slv_r.ident() ); }
1297 void removePtf( sat::Solvable slv_r,
bool showremoveProtectHint_r =
false )
1300 bool applies()
const 1301 {
return not
_ptf.empty(); }
1303 std::string description()
const {
1304 if ( not
_patch.empty() ) {
1307 << (str::Format(
_(
"%1% is not yet fully integrated into %2%.") ) % printlist(
_ptf) % printlist(
_patch)) << endl
1308 <<
_(
"Typically you want to keep the PTF and choose to not install the maintenance patches.");
1313 const std::string & removeptfCommand { str::Format(
"zypper removeptf %1%") % printlist(
_ptf) };
1316 << (str::Format(
_(
"Removing the installed %1% in this context will remove (not replace!) the included PTF-packages too." ) ) % printlist(
_ptf)) << endl
1317 << (str::Format(
_(
"The PTF should be removed by calling '%1%'. This will update the included PTF-packages rather than removing them." ) ) % removeptfCommand) << endl
1318 <<
_(
"Typically you want to keep the PTF or choose to cancel the action.");
1323 << (str::Format(
_(
"The installed %1% blocks the desired action.") ) % printlist(
_ptf)) << endl
1324 <<
_(
"Typically you want to keep the PTF and choose to cancel the action.");
1327 using StoreType = IdString;
1328 static std::string printlist(
const std::vector<StoreType> & list_r )
1329 { str::Str ret;
dumpRange( ret.stream(), list_r.begin(), list_r.end(),
"",
"",
", ",
"",
"" );
return ret; }
1339 SATResolver::problems ()
1342 if (_satSolver && solver_problem_count(_satSolver)) {
1346 Id problem, solution, element;
1347 sat::Solvable s, sd;
1349 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1350 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1352 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1355 while ((problem = solver_next_problem(_satSolver, problem)) != 0) {
1356 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1357 MIL <<
"====================================" << endl;
1360 std::string whatString = SATprobleminfoString (problem,detail,ignoreId);
1361 MIL << whatString << endl;
1362 MIL <<
"------------------------------------" << endl;
1363 ResolverProblem_Ptr resolverProblem =
new ResolverProblem (whatString, detail, SATgetCompleteProblemInfoStrings( problem ));
1364 PtfPatchHint ptfPatchHint;
1366 while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
1368 ProblemSolutionCombi *problemSolution =
new ProblemSolutionCombi;
1369 while ((element = solver_next_solutionelement(_satSolver, problem, solution, element, &p, &rp)) != 0) {
1370 if (p == SOLVER_SOLUTION_JOB) {
1372 what = _jobQueue.elements[rp];
1373 switch (_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1375 case SOLVER_INSTALL | 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, REMOVE);
1381 std::string description = str::Format(
_(
"remove lock to allow removal of %1%") ) % s.asString();
1382 MIL << description << endl;
1383 problemSolution->addDescription (description);
1384 if ( _protectPTFs && s.isPtfMaster() )
1385 ptfPatchHint.removePtf( s, _protectPTFs );
1387 problemSolution->addSingleAction (poolItem, KEEP);
1388 std::string description = str::Format(
_(
"do not install %1%") ) % s.asString();
1389 MIL << description << endl;
1390 problemSolution->addDescription (description);
1391 if ( s.isKind<Patch>() )
1392 ptfPatchHint.notInstallPatch( s );
1395 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.asString() << endl;
1399 case SOLVER_ERASE | 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, KEEP);
1405 std::string description = str::Format(
_(
"keep %1%") ) % s.asString();
1406 MIL << description << endl;
1407 problemSolution->addDescription (description);
1409 problemSolution->addSingleAction (poolItem, UNLOCK);
1410 std::string description = str::Format(
_(
"remove lock to allow installation of %1%") ) %
itemToString( poolItem );
1411 MIL << description << endl;
1412 problemSolution->addDescription (description);
1415 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.asString() << endl;
1419 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1421 IdString ident( what );
1422 SolverQueueItemInstall_Ptr install =
1423 new SolverQueueItemInstall(_pool, ident.asString(), false );
1424 problemSolution->addSingleAction (install, REMOVE_SOLVE_QUEUE_ITEM);
1426 std::string description = str::Format(
_(
"do not install %1%") ) % ident;
1427 MIL << description << endl;
1428 problemSolution->addDescription (description);
1431 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1435 IdString ident( what );
1436 FindPackage info (problemSolution, KEEP);
1438 _pool.byIdentEnd( ident ),
1440 resfilter::ByTransact ()),
1443 SolverQueueItemDelete_Ptr del =
1444 new SolverQueueItemDelete(_pool, ident.asString(), false );
1445 problemSolution->addSingleAction (del, REMOVE_SOLVE_QUEUE_ITEM);
1447 std::string description = str::Format(
_(
"keep %1%") ) % ident;
1448 MIL << description << endl;
1449 problemSolution->addDescription (description);
1452 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1454 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_REQUIRE);
1455 std::string description =
"";
1458 if (system_requires.find(Capability(what)) != system_requires.end()) {
1460 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1461 resolverProblem->setDescription(
_(
"This request will break your system!"));
1462 description =
_(
"ignore the warning of a broken system");
1463 description += std::string(
" (requires:")+pool_dep2str(pool, what)+
")";
1464 MIL << description << endl;
1465 problemSolution->addFrontDescription (description);
1467 description = str::Format(
_(
"do not ask to install a solvable providing %1%") ) % pool_dep2str(pool, what);
1468 MIL << description << endl;
1469 problemSolution->addDescription (description);
1473 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1475 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_CONFLICT);
1476 std::string description =
"";
1479 if (system_conflicts.find(Capability(what)) != system_conflicts.end()) {
1481 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1482 resolverProblem->setDescription(
_(
"This request will break your system!"));
1483 description =
_(
"ignore the warning of a broken system");
1484 description += std::string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1485 MIL << description << endl;
1486 problemSolution->addFrontDescription (description);
1489 description = str::Format(
_(
"do not ask to delete all solvables providing %1%") ) % pool_dep2str(pool, what);
1490 MIL << description << endl;
1491 problemSolution->addDescription (description);
1495 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1497 s = mapSolvable (what);
1498 PoolItem poolItem = _pool.find (s);
1500 if (pool->installed && s.get()->repo == pool->installed) {
1501 problemSolution->addSingleAction (poolItem, KEEP);
1502 std::string description = str::Format(
_(
"do not install most recent version of %1%") ) % s.asString();
1503 MIL << description << endl;
1504 problemSolution->addDescription (description);
1506 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1509 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.asString() << endl;
1514 MIL <<
"- do something different" << endl;
1515 ERR <<
"No valid solution available" << endl;
1518 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1519 s = mapSolvable (rp);
1520 PoolItem poolItem = _pool.find (s);
1521 if (pool->installed && s.get()->repo == pool->installed) {
1522 problemSolution->addSingleAction (poolItem, LOCK);
1523 std::string description = str::Format(
_(
"keep %1% despite the inferior architecture") ) % s.asString();
1524 MIL << description << endl;
1525 problemSolution->addDescription (description);
1527 problemSolution->addSingleAction (poolItem, INSTALL);
1528 std::string description = str::Format(
_(
"install %1% despite the inferior architecture") ) % s.asString();
1529 MIL << description << endl;
1530 problemSolution->addDescription (description);
1532 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1533 s = mapSolvable (rp);
1534 PoolItem poolItem = _pool.find (s);
1535 if (pool->installed && s.get()->repo == pool->installed) {
1536 problemSolution->addSingleAction (poolItem, LOCK);
1537 std::string description = str::Format(
_(
"keep obsolete %1%") ) % s.asString();
1538 MIL << description << endl;
1539 problemSolution->addDescription (description);
1541 problemSolution->addSingleAction (poolItem, INSTALL);
1542 std::string description = str::Format(
_(
"install %1% from excluded repository") ) % s.asString();
1543 MIL << description << endl;
1544 problemSolution->addDescription (description);
1546 }
else if ( p == SOLVER_SOLUTION_BLACK ) {
1549 s = mapSolvable (rp);
1550 PoolItem poolItem = _pool.find (s);
1552 problemSolution->addSingleAction (poolItem, INSTALL);
1553 std::string description;
1554 if ( s.isRetracted() ) {
1556 description = str::Format(
_(
"install %1% although it has been retracted")) % s.asString();
1557 }
else if ( s.isPtf() ) {
1559 description = str::Format(
_(
"allow installing the PTF %1%")) % s.asString();
1562 description = str::Format(
_(
"install %1% although it is blacklisted")) % s.asString();
1564 MIL << description << endl;
1565 problemSolution->addDescription( description );
1566 }
else if ( p > 0 ) {
1568 s = mapSolvable (p);
1569 PoolItem itemFrom = _pool.find (s);
1574 sd = mapSolvable (rp);
1575 PoolItem itemTo = _pool.find (sd);
1576 if (itemFrom && itemTo) {
1577 problemSolution->addSingleAction (itemTo, INSTALL);
1578 int illegal = policy_is_illegal(_satSolver, s.get(), sd.get(), 0);
1580 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1582 std::string description = str::Format(
_(
"downgrade of %1% to %2%") ) % s.asString() % sd.asString();
1583 MIL << description << endl;
1584 problemSolution->addDescription (description);
1587 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1589 std::string description = str::Format(
_(
"architecture change of %1% to %2%") ) % s.asString() % sd.asString();
1590 MIL << description << endl;
1591 problemSolution->addDescription (description);
1594 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1596 IdString s_vendor( s.vendor() );
1597 IdString sd_vendor( sd.vendor() );
1598 std::string description;
1600 description = str::Format(
_(
"install %1% (with vendor change)\n %2% --> %3%") )
1602 % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " )
1603 % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " );
1605 description = str::Format(
_(
"install %1% from vendor %2%\n replacing %3% from vendor %4%") )
1606 % sd.asString() % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " )
1607 % s.asString() % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " );
1609 MIL << description << endl;
1610 problemSolution->addDescription (description);
1614 std::string description = str::Format(
_(
"replacement of %1% with %2%") ) % s.asString() % sd.asString();
1615 MIL << description << endl;
1616 problemSolution->addDescription (description);
1619 ERR << s.asString() <<
" or " << sd.asString() <<
" not found" << endl;
1625 std::string description = str::Format(
_(
"deinstallation of %1%") ) % s.asString();
1626 MIL << description << endl;
1627 problemSolution->addDescription (description);
1628 problemSolution->addSingleAction (itemFrom, REMOVE);
1629 if ( s.isPtfMaster() )
1630 ptfPatchHint.removePtf( s );
1636 INT <<
"Unknown solution " << p << endl;
1640 resolverProblem->addSolution (problemSolution,
1641 problemSolution->actionCount() > 1 ? true :
false);
1642 MIL <<
"------------------------------------" << endl;
1647 PoolItem item = _pool.find (sat::Solvable(ignoreId));
1648 ProblemSolutionIgnore *problemSolution =
new ProblemSolutionIgnore(item);
1649 resolverProblem->addSolution (problemSolution,
1651 MIL <<
"ignore some dependencies of " << item << endl;
1652 MIL <<
"------------------------------------" << endl;
1656 if ( ptfPatchHint.applies() ) {
1657 resolverProblem->setDescription( str::Str() << ptfPatchHint.description() << endl <<
"(" << resolverProblem->description() <<
")" );
1660 resolverProblems.push_back (resolverProblem);
1663 return resolverProblems;
1667 { Resolver( _pool ).applySolutions( solutions ); }
1673 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
1681 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES );
std::list< ProblemSolution_Ptr > ProblemSolutionList
int IdType
Generic Id type.
static const IdString ptfMasterToken
Indicator provides ptf()
A Solvable object within the sat Pool.
Container of Solvable providing a Capability (read only).
PoolItemList & _items_to_remove
Focus on updating requested packages and their dependencies as much as possible.
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.
ProblemSolutionCombi * problemSolution
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
ResolverFocus
The resolver's general attitude.
bool operator()(PoolItem p)
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.
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
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.
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 ).
std::list< SolverQueueItem_Ptr > SolverQueueItemList
static void SATSolutionToPool(PoolItem item, const ResStatus &status, const ResStatus::TransactByValue causer)
size_type reposSize() const
Number of repos in Pool.
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.
Queue StringQueue
Queue with String ids.
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.
std::list< ResolverProblem_Ptr > ResolverProblemList
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
detail::CPool * get() const
Expert backdoor.
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 isPseudoInstalled(ResKind kind_r)
Those are denoted to be installed, if the solver verifies them as being satisfied.
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
bool operator()(const PoolItem &item_r)
bool setToBeUninstalled(TransactByValue causer)
FindPackage(ProblemSolutionCombi *p, const TransactionKind act)
Libsolv Id queue wrapper.
PoolItemList & _items_to_keep
bool compareByNVR(const SolvableType< Derived > &lhs, const Solvable &rhs)
std::unordered_set< Capability > CapabilitySet
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.
::s_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
bool isToBeUninstalled() const
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)
IMPL_PTR_TYPE(SATResolver)
Combining sat::Solvable and ResStatus.
Pathname systemRoot() const
The target root directory.
static const IdString retractedToken
Indicator provides retracted-patch-package()
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
static ResPool instance()
Singleton ctor.