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() );
213 ::map_init( &installedmap, cPool->nsolvables );
214 if ( cPool->installed )
218 FOR_REPO_SOLVABLES( cPool->installed,
p,
s )
219 MAPSET( &installedmap,
p );
222 ::Map multiversionmap;
223 ::map_init( &multiversionmap, 0 );
224 ::solver_calculate_multiversionmap( cPool, jobQueue, &multiversionmap );
226 ::pool_trivial_installable_multiversionmap( cPool, &installedmap, pseudoItems_r, pseudoFlags_r,
227 multiversionmap.
size ? &multiversionmap :
nullptr );
230 if ( pseudoFlags_r[i] == -1 )
232 ::Solvable *
s { cPool->solvables + pseudoItems_r[i] };
233 if ( ::strncmp(
"patch:", ::pool_id2str( cPool,
s->name ), 6 ) == 0
234 && ::solvable_is_irrelevant_patch(
s, &installedmap ) )
235 pseudoFlags_r[i] = -1;
238 ::map_free( &multiversionmap );
239 ::map_free( &installedmap );
244 switch ( pseudoFlags_r[i] )
252 MIL <<
"Establish DONE" << endl;
255 MIL <<
"Establish not needed." << endl;
261 return std::string();
277SATResolver::dumpOn( std::ostream & os )
const
279 os <<
"<resolver>" << endl;
281#define OUTS(X) os << " " << #X << "\t= " << solver_get_flag(_satSolver, SOLVER_FLAG_##X) << endl
282 OUTS( ALLOW_DOWNGRADE );
283 OUTS( ALLOW_ARCHCHANGE );
284 OUTS( ALLOW_VENDORCHANGE );
285 OUTS( ALLOW_NAMECHANGE );
286 OUTS( ALLOW_UNINSTALL );
287 OUTS( NO_UPDATEPROVIDE );
288 OUTS( SPLITPROVIDES );
289 OUTS( ONLY_NAMESPACE_RECOMMENDED );
290 OUTS( ADD_ALREADY_RECOMMENDED );
291 OUTS( NO_INFARCHCHECK );
292 OUTS( KEEP_EXPLICIT_OBSOLETES );
293 OUTS( BEST_OBEY_POLICY );
294 OUTS( NO_AUTOTARGET );
295 OUTS( DUP_ALLOW_DOWNGRADE );
296 OUTS( DUP_ALLOW_ARCHCHANGE );
297 OUTS( DUP_ALLOW_VENDORCHANGE );
298 OUTS( DUP_ALLOW_NAMECHANGE );
299 OUTS( KEEP_ORPHANS );
300 OUTS( BREAK_ORPHANS );
301 OUTS( YUM_OBSOLETES );
303 os <<
" focus = " << _focus << endl;
304 os <<
" distupgrade = " << _distupgrade << endl;
305 os <<
" removeOrphaned = " << _removeOrphaned << endl;
306 os <<
" solveSrcPackages = " << _solveSrcPackages << endl;
307 os <<
" cleandepsOnRemove = " << _cleandepsOnRemove << endl;
308 os <<
" fixsystem = " << _fixsystem << endl;
312 return os <<
"<resolver/>" << endl;
319 : _pool(std::move(pool))
322 , _focus ( ZConfig::instance().solver_focus() )
324 , _allowdowngrade ( false )
325 , _allownamechange ( true )
326 , _allowarchchange ( false )
327 , _allowvendorchange ( ZConfig::instance().solver_allowVendorChange() )
328 , _allowuninstall ( false )
329 , _updatesystem ( false )
330 , _noUpdateProvide ( ZConfig::instance().solver_noUpdateProvide() )
331 , _dosplitprovides ( true )
332 , _onlyRequires (ZConfig::instance().solver_onlyRequires())
333 , _ignorealreadyrecommended(true)
334 , _distupgrade(false)
335 , _removeOrphaned(false)
336 , _removeUnneeded(false)
337 , _dup_allowdowngrade ( ZConfig::instance().solver_dupAllowDowngrade() )
338 , _dup_allownamechange ( ZConfig::instance().solver_dupAllowNameChange() )
339 , _dup_allowarchchange ( ZConfig::instance().solver_dupAllowArchChange() )
340 , _dup_allowvendorchange ( ZConfig::instance().solver_dupAllowVendorChange() )
341 , _solveSrcPackages(false)
342 , _cleandepsOnRemove(ZConfig::instance().solver_cleandepsOnRemove())
347SATResolver::~SATResolver()
355SATResolver::pool (
void)
const
377 XDEBUG(
"SATSolutionToPool install returns " << item <<
", " << r);
381 XDEBUG(
"SATSolutionToPool upgrade returns " << item <<
", " << r);
385 XDEBUG(
"SATSolutionToPool remove returns " << item <<
", " << r);
406 PoolItemList & items_to_remove_r,
407 PoolItemList & items_to_lock_r,
408 PoolItemList & items_to_keep_r,
409 bool solveSrcPackages_r )
463SATResolver::solverEnd()
468 solver_free(_satSolver);
470 queue_free( &(_jobQueue) );
475SATResolver::solverInit(
const PoolItemList & weakItems)
477 MIL <<
"SATResolver::solverInit()" << endl;
481 _satSolver = solver_create( _satPool );
482 queue_init( &_jobQueue );
487 bool toRelax =
false;
488 if ( _distupgrade ) {
490 if ( ! solv.isSystem() ) {
491 MIL <<
"Relaxed vendor check requested by " << solv << endl;
497 ::pool_set_custom_vendorcheck( _satPool, toRelax ? &relaxedVendorCheck : &vendorCheck );
501 ::pool_add_userinstalled_jobs(_satPool,
sat::Pool::instance().autoInstalled(), &(_jobQueue), GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED);
506 SATCollectTransact
collector( _items_to_install, _items_to_remove, _items_to_lock, _items_to_keep, solveSrcPackages() );
507 invokeOnEach ( _pool.begin(), _pool.end(), std::ref( collector ) );
511 for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
514 ERR <<
"Weaken: " << *iter <<
" not found" << endl;
516 MIL <<
"Weaken dependencies of " << *iter << endl;
517 queue_push( &(_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
518 queue_push( &(_jobQueue),
id );
523 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
525 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
532 const auto & trackedLocaleIds( myPool().trackedLocaleIds() );
535 for (
const auto & locale : trackedLocaleIds.added() )
537 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
541 for (
const auto & locale : trackedLocaleIds.removed() )
543 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES | SOLVER_CLEANDEPS );
549 for (
const sat::Solvable & solv : myPool().multiversionList() )
551 queue_push( &(_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
552 queue_push( &(_jobQueue), solv.id() );
561 if ( _protectPTFs ) {
562 for (
const auto & solv : sat::AllPTFs() ) {
563 if ( solv.isSystem() ) {
564 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
565 queue_push( &(_jobQueue), solv.id() );
572 solverInitSetSystemRequirements();
575 solverInitSetLocks();
578 solverInitSetModeJobsAndFlags();
581void SATResolver::solverInitSetSystemRequirements()
583 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
584 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
586 for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
587 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
588 queue_push( &(_jobQueue), iter->id() );
589 MIL <<
"SYSTEM Requires " << *iter << endl;
592 for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
593 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
594 queue_push( &(_jobQueue), iter->id() );
595 MIL <<
"SYSTEM Conflicts " << *iter << endl;
604 for_( it, pool.byIdentBegin(rpm), pool.byIdentEnd(rpm) )
606 if ( (*it)->isSystem() )
609 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
610 queue_push( &(_jobQueue), archrule.id() );
617void SATResolver::solverInitSetLocks()
622 for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter != _items_to_lock.end(); ++iter) {
624 if (iter->status().isInstalled()) {
626 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
627 queue_push( &(_jobQueue),
id );
630 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
631 queue_push( &(_jobQueue),
id );
634 MIL <<
"Locked " << icnt <<
" installed items and " << acnt <<
" NOT installed items." << endl;
640 std::set<IdString> unifiedByName;
641 for (PoolItemList::const_iterator iter = _items_to_keep.begin(); iter != _items_to_keep.end(); ++iter) {
643 if ( unifiedByName.insert( ident ).second )
647 MIL <<
"Keep NOT installed name " << ident <<
" (" << *iter <<
")" << endl;
648 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | SOLVER_WEAK |
MAYBE_CLEANDEPS );
649 queue_push( &(_jobQueue), ident.id() );
655void SATResolver::solverInitSetModeJobsAndFlags()
658 queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
659 queue_push( &(_jobQueue), 0 );
662 queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
663 queue_push( &(_jobQueue), 0 );
666 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
667 queue_push( &(_jobQueue), 0 );
672 if (_removeOrphaned) {
673 queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
674 queue_push( &(_jobQueue), 0 );
677 if (_removeUnneeded) {
678 invokeOnEach ( _pool.begin(), _pool.end(), [
this](
const PoolItem & pi_r ) {
679 if ( pi_r.status().isUnneeded() ) {
680 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | SOLVER_WEAK | MAYBE_CLEANDEPS );
681 queue_push( &(_jobQueue), pi_r.ident().id() );
687 solverSetFocus( *_satSolver, _focus );
688 solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
689 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
690 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
691 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
692 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange);
693 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
694 solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noUpdateProvide);
695 solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
696 solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED,
false);
697 solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires);
698 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade );
699 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange );
700 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange );
701 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, _dup_allowvendorchange );
745 MIL <<
"Starting solving...." << endl;
747 if ( solver_solve( _satSolver, &(_jobQueue) ) == 0 )
754 if ( _removeOrphaned )
755 MIL <<
"Droplist processing not needed. RemoveUnsupported is On." << endl;
757 MIL <<
"Droplist processing is disabled in ZConfig." << endl;
760 bool resolve =
false;
761 MIL <<
"Checking droplists ..." << endl;
764 solver_get_decisionqueue( _satSolver, decisionq );
771 static const Capability productCap {
"product()" };
775 MIL <<
"Droplist for " << slv <<
": size " << droplist.size() << endl;
776 if ( !droplist.empty() )
778 for (
const auto & cap : droplist )
780 queue_push( &_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
781 queue_push( &_jobQueue, cap.id() );
784 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
785 queue_push( &(_jobQueue),
id );
791 solver_solve( _satSolver, &(_jobQueue) );
795 MIL <<
"....Solver end" << endl;
799 _result_items_to_install.clear();
800 _result_items_to_remove.clear();
804 queue_init(&decisionq);
805 solver_get_decisionqueue(_satSolver, &decisionq);
806 for (
int i = 0; i < decisionq.count; ++i )
808 Id
p = decisionq.elements[i];
813 if ( ! slv || slv.isSystem() )
818 _result_items_to_install.push_back( poolItem );
820 queue_free(&decisionq);
824 if ( systemRepo && ! systemRepo.solvablesEmpty() )
826 bool mustCheckObsoletes =
false;
827 for_( it, systemRepo.solvablesBegin(), systemRepo.solvablesEnd() )
829 if (solver_get_decisionlevel(_satSolver, it->id()) > 0)
833 CheckIfUpdate
info( *it );
836 _pool.byIdentEnd( poolItem ),
840 if (
info.is_updated) {
844 if ( ! mustCheckObsoletes )
845 mustCheckObsoletes =
true;
847 _result_items_to_remove.push_back (poolItem);
849 if ( mustCheckObsoletes )
851 sat::WhatObsoletes obsoleted( _result_items_to_install.begin(), _result_items_to_install.end() );
852 for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
856 if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
857 status.setToBeUninstalledDueToObsolete();
864 solverCopyBackWeak( *_satSolver, _problem_items );
865 solverCopyBackValidate( *_satSolver, _pool );
870 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
872 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
874 if (poolItem.status().isToBeInstalled()) {
875 MIL <<
"User requirement " << *iter <<
" sets " << poolItem << endl;
880 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
882 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
884 if (poolItem.status().isToBeUninstalled()) {
885 MIL <<
"User conflict " << *iter <<
" sets " << poolItem << endl;
891 if (solver_problem_count(_satSolver) > 0 )
893 ERR <<
"Solverrun finished with an ERROR" << endl;
900void SATResolver::solverAddJobsFromPool()
902 for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
905 ERR <<
"Install: " << *iter <<
" not found" << endl;
907 MIL <<
"Install " << *iter << endl;
908 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
909 queue_push( &(_jobQueue),
id );
913 for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
916 ERR <<
"Delete: " << *iter <<
" not found" << endl;
918 MIL <<
"Delete " << *iter << endl;
919 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
920 queue_push( &(_jobQueue),
id);
927 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
928 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
929 queue_push( &(_jobQueue), iter->id() );
930 MIL <<
"Requires " << *iter << endl;
933 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
934 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
935 queue_push( &(_jobQueue), iter->id() );
936 MIL <<
"Conflicts " << *iter << endl;
943 const PoolItemList & weakItems,
944 const std::set<Repository> & upgradeRepos)
946 MIL <<
"SATResolver::resolvePool()" << endl;
949 solverInit(weakItems);
952 solverAddJobsFromPool();
953 solverAddJobsFromExtraQueues( requires_caps, conflict_caps );
955 for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
957 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
958 queue_push( &(_jobQueue), iter->get()->repoid );
959 MIL <<
"Upgrade repo " << *iter << endl;
963 bool ret = solving(requires_caps, conflict_caps);
965 (ret?
MIL:
WAR) <<
"SATResolver::resolvePool() done. Ret:" << ret << endl;
971SATResolver::resolveQueue(
const SolverQueueItemList &requestQueue,
972 const PoolItemList & weakItems)
974 MIL <<
"SATResolver::resolvQueue()" << endl;
977 solverInit(weakItems);
980 for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
981 (*iter)->addRule(_jobQueue);
985 solverAddJobsFromPool();
988 bool ret = solving();
990 (ret?
MIL:
WAR) <<
"SATResolver::resolveQueue() done. Ret:" << ret << endl;
995void SATResolver::doUpdate()
997 MIL <<
"SATResolver::doUpdate()" << endl;
1000 solverInit(PoolItemList());
1010 MIL <<
"Starting solving for update...." << endl;
1012 solver_solve( _satSolver, &(_jobQueue) );
1013 MIL <<
"....Solver end" << endl;
1020 queue_init(&decisionq);
1021 solver_get_decisionqueue(_satSolver, &decisionq);
1022 for (
int i = 0; i < decisionq.count; i++)
1024 Id
p = decisionq.elements[i];
1029 if ( ! solv || solv.isSystem() )
1034 queue_free(&decisionq);
1037 if ( _satSolver->pool->installed ) {
1038 for (
int i = _satSolver->pool->installed->start; i < _satSolver->
pool->installed->start + _satSolver->pool->installed->nsolvables; i++)
1040 if (solver_get_decisionlevel(_satSolver, i) > 0)
1048 _pool.byIdentEnd( poolItem ),
1052 if (
info.is_updated) {
1058 ERR <<
"id " << i <<
" not found in ZYPP pool." << endl;
1065 solverCopyBackWeak( *_satSolver, _problem_items );
1066 solverCopyBackValidate( *_satSolver, _pool );
1068 MIL <<
"SATResolver::doUpdate() done" << endl;
1123{
return PoolItem( mapBuddy( item ) ); }
1128std::vector<std::string> SATResolver::SATgetCompleteProblemInfoStrings ( Id problem, std::string & detail_r, Id & ignoreId_r )
1130 std::vector<std::string> ret;
1131 sat::Queue problems;
1132 solver_findallproblemrules( _satSolver, problem, problems );
1136 Id probr = solver_findproblemrule( _satSolver, problem );
1137 ret.push_back( SATproblemRuleInfoString( probr, detail_r, ignoreId_r ) );
1144 if ( problems[i] == probr )
1146 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1147 if ( ruleClass != SolverRuleinfo::SOLVER_RULE_UPDATE && ruleClass != SolverRuleinfo::SOLVER_RULE_JOB ) {
1153 if ( problems[i] == probr )
1155 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1156 if ( nobad && ( ruleClass == SolverRuleinfo::SOLVER_RULE_UPDATE || ruleClass == SolverRuleinfo::SOLVER_RULE_JOB ) ) {
1162 std::string pInfo = SATproblemRuleInfoString( problems[i],
detail, ignore );
1165 if ( std::find( ret.begin(), ret.end(), pInfo ) == ret.end() )
1166 ret.push_back( pInfo );
1171std::string SATResolver::SATproblemRuleInfoString (Id probr, std::string &
detail, Id &ignoreId)
1175 Id dep = 0, source = 0,
target = 0;
1176 SolverRuleinfo type = solver_ruleinfo(_satSolver, probr, &source, &
target, &dep);
1188 case SOLVER_RULE_DISTUPGRADE:
1190 ret =
str::Format(
_(
"the installed %1% does not belong to a distupgrade repository and must be replaced") ) %
s.
asString();
1192 ret =
str::Format(
_(
"the to be installed %1% does not belong to a distupgrade repository") ) %
s.
asString();
1194 case SOLVER_RULE_INFARCH:
1200 case SOLVER_RULE_UPDATE:
1203 case SOLVER_RULE_JOB:
1204 ret =
_(
"conflicting requests");
1206 case SOLVER_RULE_PKG:
1207 ret =
_(
"some dependency problem");
1209 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1210 ret =
str::Format(
_(
"nothing provides the requested '%1%'") ) % pool_dep2str(
pool, dep);
1211 detail +=
_(
"Have you enabled all the required repositories?");
1213 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1214 ret =
str::Format(
_(
"the requested package %1% does not exist") ) % pool_dep2str(
pool, dep);
1215 detail +=
_(
"Have you enabled all the required repositories?");
1217 case SOLVER_RULE_JOB_UNSUPPORTED:
1218 ret =
_(
"unsupported request");
1220 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1221 ret =
str::Format(
_(
"'%1%' is provided by the system and cannot be erased") ) % pool_dep2str(
pool, dep);
1223 case SOLVER_RULE_PKG_NOT_INSTALLABLE:
1226 case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
1231 ret =
str::Format(
_(
"nothing provides '%1%' needed by the to be installed %2%") ) % pool_dep2str(
pool, dep) %
s.
asString();
1233 case SOLVER_RULE_PKG_SAME_NAME:
1236 case SOLVER_RULE_PKG_CONFLICTS:
1237 if (
s.isSystem() ) {
1238 if ( s2.isSystem() )
1239 ret =
str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the installed %3%") ) %
s.
asString() % pool_dep2str(
pool, dep) % s2.asString();
1241 ret =
str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the to be installed %3%") ) %
s.
asString() % pool_dep2str(
pool, dep) % s2.asString();
1244 if ( s2.isSystem() )
1245 ret =
str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by the installed %3%") ) %
s.
asString() % pool_dep2str(
pool, dep) % s2.asString();
1247 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();
1250 case SOLVER_RULE_PKG_OBSOLETES:
1251 case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
1252 if (
s.isSystem() ) {
1253 if ( s2.isSystem() )
1254 ret =
str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the installed %3%") ) %
s.
asString() % pool_dep2str(
pool, dep) % s2.asString();
1256 ret =
str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the to be installed %3%") ) %
s.
asString() % pool_dep2str(
pool, dep) % s2.asString();
1259 if ( s2.isSystem() )
1260 ret =
str::Format(
_(
"the to be installed %1% obsoletes '%2%' provided by the installed %3%") ) %
s.
asString() % pool_dep2str(
pool, dep) % s2.asString();
1262 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();
1265 case SOLVER_RULE_PKG_SELF_CONFLICT:
1267 ret =
str::Format(
_(
"the installed %1% conflicts with '%2%' provided by itself") ) %
s.
asString() % pool_dep2str(
pool, dep);
1269 ret =
str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by itself") ) %
s.
asString() % pool_dep2str(
pool, dep);
1271 case SOLVER_RULE_PKG_REQUIRES: {
1277 typedef std::list<PoolItem> ProviderList;
1278 ProviderList providerlistInstalled, providerlistUninstalled;
1279 for_( iter1, possibleProviders.begin(), possibleProviders.end() ) {
1283 for_( iter2, possibleProviders.begin(), possibleProviders.end() ) {
1286 && ( (provider1.status().isInstalled() && provider2.status().isUninstalled())
1287 || (provider2.status().isInstalled() && provider1.status().isUninstalled()) )) {
1293 if (provider1.status().isInstalled())
1294 providerlistInstalled.push_back(provider1);
1296 providerlistUninstalled.push_back(provider1);
1301 ret =
str::Format(
_(
"the installed %1% requires '%2%', but this requirement cannot be provided") ) %
s.
asString() % pool_dep2str(
pool, dep);
1303 ret =
str::Format(
_(
"the to be installed %1% requires '%2%', but this requirement cannot be provided") ) %
s.
asString() % pool_dep2str(
pool, dep);
1304 if (providerlistInstalled.size() > 0) {
1305 detail +=
_(
"deleted providers: ");
1306 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1307 if (iter == providerlistInstalled.begin())
1313 if (providerlistUninstalled.size() > 0) {
1315 detail +=
_(
"\nnot installable providers: ");
1317 detail =
_(
"not installable providers: ");
1318 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1319 if (iter == providerlistUninstalled.begin())
1328 DBG <<
"Unknown rule type(" << type <<
") going to query libsolv for rule information." << endl;
1329 ret =
str::asString( ::solver_problemruleinfo2str( _satSolver, type,
static_cast<Id
>(
s.id()),
static_cast<Id
>(s2.id()), dep ) );
1341 void notInstallPatch( sat::Solvable slv_r )
1342 { _patch.push_back( slv_r.ident() ); }
1344 void removePtf( sat::Solvable slv_r,
bool showremoveProtectHint_r =
false )
1345 { _ptf.push_back( slv_r.ident() );
if ( showremoveProtectHint_r ) _showremoveProtectHint =
true; }
1347 bool applies()
const
1348 {
return not _ptf.empty(); }
1350 std::string description()
const {
1351 if ( not _patch.empty() ) {
1354 << (str::Format(
_(
"%1% is not yet fully integrated into %2%.") ) % printlist(_ptf) % printlist(_patch)) << endl
1355 <<
_(
"Typically you want to keep the PTF and choose to not install the maintenance patches.");
1359 if ( _showremoveProtectHint ) {
1360 const std::string & removeptfCommand { str::Format(
"zypper removeptf %1%") % printlist(_ptf) };
1363 << (str::Format(
_(
"Removing the installed %1% in this context will remove (not replace!) the included PTF-packages too." ) ) % printlist(_ptf)) << endl
1364 << (str::Format(
_(
"The PTF should be removed by calling '%1%'. This will update the included PTF-packages rather than removing them." ) ) % removeptfCommand) << endl
1365 <<
_(
"Typically you want to keep the PTF or choose to cancel the action.");
1370 << (str::Format(
_(
"The installed %1% blocks the desired action.") ) % printlist(_ptf)) << endl
1371 <<
_(
"Typically you want to keep the PTF and choose to cancel the action.");
1375 static std::string printlist(
const std::vector<StoreType> & list_r )
1376 { str::Str ret;
dumpRange( ret.stream(), list_r.begin(), list_r.end(),
"",
"",
", ",
"",
"" );
return ret; }
1378 std::vector<StoreType> _ptf;
1379 std::vector<StoreType> _patch;
1380 bool _showremoveProtectHint =
false;
1386SATResolver::problems ()
1389 if (_satSolver && solver_problem_count(_satSolver)) {
1392 Id
p = 0, rp = 0, what = 0;
1393 Id problem = 0, solution = 0, element = 0;
1396 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1397 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1399 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1402 while ((problem = solver_next_problem(_satSolver, problem)) != 0) {
1403 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1404 MIL <<
"====================================" << endl;
1406 ResolverProblem_Ptr resolverProblem;
1409 std::vector<std::string> allWhatStrings = SATgetCompleteProblemInfoStrings( problem,
detail, ignoreId );
1410 std::string whatString = allWhatStrings[0];
1411 for (
const auto & problemString : allWhatStrings )
1412 MIL <<
"- " << problemString << endl;
1413 MIL <<
"------------------------------------" << endl;
1414 resolverProblem =
new ResolverProblem( std::move(whatString), std::move(
detail), std::move(allWhatStrings) );
1416 PtfPatchHint ptfPatchHint;
1418 while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
1420 ProblemSolutionCombi *problemSolution =
new ProblemSolutionCombi;
1421 while ((element = solver_next_solutionelement(_satSolver, problem, solution, element, &
p, &rp)) != 0) {
1422 if (
p == SOLVER_SOLUTION_JOB) {
1424 what = _jobQueue.elements[rp];
1425 switch (_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1427 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1428 s = mapSolvable (what);
1431 if (
pool->installed &&
s.get()->repo ==
pool->installed) {
1432 problemSolution->addSingleAction (poolItem, REMOVE);
1434 MIL << description << endl;
1435 problemSolution->addDescription (description);
1436 if ( _protectPTFs &&
s.isPtfMaster() )
1437 ptfPatchHint.removePtf(
s, _protectPTFs );
1439 problemSolution->addSingleAction (poolItem, KEEP);
1441 MIL << description << endl;
1442 problemSolution->addDescription (description);
1444 ptfPatchHint.notInstallPatch(
s );
1447 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " <<
s.asString() << endl;
1451 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1452 s = mapSolvable (what);
1455 if (
pool->installed &&
s.get()->repo ==
pool->installed) {
1456 problemSolution->addSingleAction (poolItem, KEEP);
1458 MIL << description << endl;
1459 problemSolution->addDescription (description);
1461 problemSolution->addSingleAction (poolItem, UNLOCK);
1463 MIL << description << endl;
1464 problemSolution->addDescription (description);
1467 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " <<
s.asString() << endl;
1471 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1474 SolverQueueItemInstall_Ptr install =
1475 new SolverQueueItemInstall(_pool, ident.asString(),
false );
1476 problemSolution->addSingleAction (install, REMOVE_SOLVE_QUEUE_ITEM);
1478 std::string description =
str::Format(
_(
"do not install %1%") ) % ident;
1479 MIL << description << endl;
1480 problemSolution->addDescription (description);
1483 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1488 FindPackage
info (problemSolution, KEEP);
1490 _pool.byIdentEnd( ident ),
1495 SolverQueueItemDelete_Ptr del =
1496 new SolverQueueItemDelete(_pool, ident.asString(),
false );
1497 problemSolution->addSingleAction (del, REMOVE_SOLVE_QUEUE_ITEM);
1499 std::string description =
str::Format(
_(
"keep %1%") ) % ident;
1500 MIL << description << endl;
1501 problemSolution->addDescription (description);
1504 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1506 problemSolution->addSingleAction (
Capability(what), REMOVE_EXTRA_REQUIRE);
1507 std::string description =
"";
1510 if (system_requires.find(
Capability(what)) != system_requires.end()) {
1512 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1513 resolverProblem->setDescription(
_(
"This request will break your system!"));
1514 description =
_(
"ignore the warning of a broken system");
1515 description += std::string(
" (requires:")+pool_dep2str(
pool, what)+
")";
1516 MIL << description << endl;
1517 problemSolution->addFrontDescription (description);
1519 description =
str::Format(
_(
"do not ask to install a solvable providing %1%") ) % pool_dep2str(
pool, what);
1520 MIL << description << endl;
1521 problemSolution->addDescription (description);
1525 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1527 problemSolution->addSingleAction (
Capability(what), REMOVE_EXTRA_CONFLICT);
1528 std::string description =
"";
1531 if (system_conflicts.find(
Capability(what)) != system_conflicts.end()) {
1533 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1534 resolverProblem->setDescription(
_(
"This request will break your system!"));
1535 description =
_(
"ignore the warning of a broken system");
1536 description += std::string(
" (conflicts:")+pool_dep2str(
pool, what)+
")";
1537 MIL << description << endl;
1538 problemSolution->addFrontDescription (description);
1541 description =
str::Format(
_(
"do not ask to delete all solvables providing %1%") ) % pool_dep2str(
pool, what);
1542 MIL << description << endl;
1543 problemSolution->addDescription (description);
1547 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1549 s = mapSolvable (what);
1552 if (
pool->installed &&
s.get()->repo ==
pool->installed) {
1553 problemSolution->addSingleAction (poolItem, KEEP);
1554 std::string description =
str::Format(
_(
"do not install most recent version of %1%") ) %
s.
asString();
1555 MIL << description << endl;
1556 problemSolution->addDescription (description);
1558 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1561 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " <<
s.asString() << endl;
1566 MIL <<
"- do something different" << endl;
1567 ERR <<
"No valid solution available" << endl;
1570 }
else if (
p == SOLVER_SOLUTION_INFARCH) {
1571 s = mapSolvable (rp);
1573 if (
pool->installed &&
s.get()->repo ==
pool->installed) {
1574 problemSolution->addSingleAction (poolItem, LOCK);
1575 std::string description =
str::Format(
_(
"keep %1% despite the inferior architecture") ) %
s.
asString();
1576 MIL << description << endl;
1577 problemSolution->addDescription (description);
1579 problemSolution->addSingleAction (poolItem, INSTALL);
1580 std::string description =
str::Format(
_(
"install %1% despite the inferior architecture") ) %
s.
asString();
1581 MIL << description << endl;
1582 problemSolution->addDescription (description);
1584 }
else if (
p == SOLVER_SOLUTION_DISTUPGRADE) {
1585 s = mapSolvable (rp);
1587 if (
pool->installed &&
s.get()->repo ==
pool->installed) {
1588 problemSolution->addSingleAction (poolItem, LOCK);
1590 MIL << description << endl;
1591 problemSolution->addDescription (description);
1593 problemSolution->addSingleAction (poolItem, INSTALL);
1595 MIL << description << endl;
1596 problemSolution->addDescription (description);
1598 }
else if (
p == SOLVER_SOLUTION_BLACK ) {
1601 s = mapSolvable (rp);
1604 problemSolution->addSingleAction (poolItem, INSTALL);
1605 std::string description;
1606 if (
s.isRetracted() ) {
1609 }
else if (
s.isPtf() ) {
1616 MIL << description << endl;
1617 problemSolution->addDescription( description );
1618 }
else if (
p > 0 ) {
1620 s = mapSolvable (
p);
1626 sd = mapSolvable (rp);
1628 if (itemFrom && itemTo) {
1629 problemSolution->addSingleAction (itemTo, INSTALL);
1630 int illegal = policy_is_illegal(_satSolver,
s.get(), sd.get(), 0);
1632 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1634 std::string description =
str::Format(
_(
"downgrade of %1% to %2%") ) %
s.
asString() % sd.asString();
1635 MIL << description << endl;
1636 problemSolution->addDescription (description);
1639 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1641 std::string description =
str::Format(
_(
"architecture change of %1% to %2%") ) %
s.
asString() % sd.asString();
1642 MIL << description << endl;
1643 problemSolution->addDescription (description);
1646 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1650 std::string description;
1652 description =
str::Format(
_(
"install %1% (with vendor change)\n %2% --> %3%") )
1654 % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " )
1655 % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " );
1657 description =
str::Format(
_(
"install %1% from vendor %2%\n replacing %3% from vendor %4%") )
1658 % sd.
asString() % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " )
1659 %
s.asString() % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " );
1661 MIL << description << endl;
1662 problemSolution->addDescription (description);
1666 std::string description =
str::Format(
_(
"replacement of %1% with %2%") ) %
s.
asString() % sd.asString();
1667 MIL << description << endl;
1668 problemSolution->addDescription (description);
1671 ERR <<
s.asString() <<
" or " << sd.asString() <<
" not found" << endl;
1678 MIL << description << endl;
1679 problemSolution->addDescription (description);
1680 problemSolution->addSingleAction (itemFrom, REMOVE);
1681 if (
s.isPtfMaster() )
1682 ptfPatchHint.removePtf(
s );
1688 INT <<
"Unknown solution " <<
p << endl;
1692 resolverProblem->addSolution (problemSolution,
1693 problemSolution->actionCount() > 1 ?
true :
false);
1694 MIL <<
"------------------------------------" << endl;
1700 ProblemSolutionIgnore *problemSolution =
new ProblemSolutionIgnore(item);
1701 resolverProblem->addSolution (problemSolution,
1703 MIL <<
"ignore some dependencies of " << item << endl;
1704 MIL <<
"------------------------------------" << endl;
1708 if ( ptfPatchHint.applies() ) {
1709 resolverProblem->setDescription(
str::Str() << ptfPatchHint.description() << endl <<
"(" << resolverProblem->description() <<
")" );
1712 resolverProblems.push_back (resolverProblem);
1715 return resolverProblems;
1725 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
1733 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES );
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
bool matches(const Capability &lhs) const
Return whether lhs matches at least one capability in set.
Access to the sat-pools string space.
Class representing a patch.
Combining sat::Solvable and ResStatus.
ResStatus & status() const
Returns the current status.
sat::Solvable buddy() const
Return the buddy we share our status object with.
std::string alias() const
Short unique string to identify a repo.
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
static ResPool instance()
Singleton ctor.
static const ResStatus toBeInstalled
bool setToBeUninstalled(TransactByValue causer)
bool isToBeInstalled() const
bool setToBeInstalled(TransactByValue causer)
TransactValue getTransactValue() const
static const ResStatus toBeUninstalledDueToUpgrade
static const ResStatus toBeUninstalled
bool isToBeUninstalled() const
bool isToBeUninstalledDueToUpgrade() const
bool resetTransact(TransactByValue causer_r)
Not the same as setTransact( false ).
bool setToBeUninstalledDueToUpgrade(TransactByValue causer)
bool isUninstalled() const
Describe a solver problem and offer solutions.
Dependency resolver interface.
void applySolutions(const ProblemSolutionList &solutions)
Apply problem solutions.
bool equivalent(const Vendor &lVendor, const Vendor &rVendor) const
Return whether two vendor strings should be treated as the same vendor.
bool relaxedEquivalent(const Vendor &lVendor, const Vendor &rVendor) const
Like equivalent but always unifies suse and openSUSE vendor.
static const VendorAttr & instance()
(Pseudo)Singleton, mapped to the current Target::vendorAttr settings or to noTargetInstance.
static ZConfig & instance()
Singleton ctor.
size_type reposSize() const
Number of repos in Pool.
static Pool instance()
Singleton ctor.
void prepare() const
Update housekeeping data if necessary (e.g.
Libsolv Id queue wrapper.
void push(value_type val_r)
Push a value to the end off the Queue.
A Solvable object within the sat Pool.
std::string asString() const
String representation "ident-edition.arch" or "noSolvable".
static const IdString ptfMasterToken
Indicator provides ptf()
bool isSystem() const
Return whether this Solvable belongs to the system repo.
static const IdString retractedToken
Indicator provides retracted-patch-package()
Capabilities dep_provides() const
CapabilitySet valuesOfNamespace(const std::string &namespace_r) const
Return 'value[ op edition]' for namespaced provides 'namespace(value)[ op edition]'.
Repository repository() const
The Repository this Solvable belongs to.
Container of installed Solvable which would be obsoleted by the Solvable passed to the ctor.
Container of Solvable providing a Capability (read only).
bool operator()(const PoolItem &item)
CheckIfUpdate(const sat::Solvable &installed_r)
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
nullptr CURL handle void p CURLversion nullptr struct curl_slist list CURLM CURLM_INTERNAL_ERROR CURLM CURL CURLM_INTERNAL_ERROR CURLM curl_socket_t s
nullptr CURL handle void p CURLversion nullptr struct curl_slist list CURLM CURLM_INTERNAL_ERROR CURLM CURL CURLM_INTERNAL_ERROR CURLM curl_socket_t int int CURLM_INTERNAL_ERROR CURLINFO info
nullptr CURL handle void * p
Chain< TACondition, TBCondition > chain(TACondition conda_r, TBCondition condb_r)
Convenience function for creating a Chain from two conditions conda_r and condb_r.
Collector< TOutputIterator > collector(TOutputIterator iter_r)
relates: Collector Convenience constructor.
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
int IdType
Generic Id type.
::s_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
Queue SolvableQueue
Queue with Solvable ids.
Queue StringQueue
Queue with String ids.
int vendorCheck(sat::detail::CPool *pool, Solvable *solvable1, Solvable *solvable2)
static void SATSolutionToPool(const PoolItem &item, const ResStatus &status, const ResStatus::TransactByValue causer)
void establish(sat::Queue &pseudoItems_r, sat::Queue &pseudoFlags_r)
ResPool helper to compute the initial status of Patches etc.
int relaxedVendorCheck(sat::detail::CPool *pool, Solvable *solvable1, Solvable *solvable2)
sat::Solvable mapBuddy(const PoolItem &item_r)
std::string itemToString(const PoolItem &item)
const std::string & asString(const std::string &t)
Global asString() that works with std::string too.
bool isPseudoInstalled(const ResKind &kind_r)
Those are denoted to be installed, if the solver verifies them as being satisfied.
Easy-to use interface to the ZYPP dependency resolver.
@ language
language support
std::list< ProblemSolution_Ptr > ProblemSolutionList
std::ostream & dumpRange(std::ostream &str, TIterator begin, TIterator end, const std::string &intro="{", const std::string &pfx="\n ", const std::string &sep="\n ", const std::string &sfx="\n", const std::string &extro="}")
Print range defined by iterators (multiline style).
@ Update
Focus on updating requested packages and their dependencies as much as possible.
@ Default
Request the standard behavior (as defined in zypp.conf or 'Job')
@ Installed
Focus on applying as little changes to the installed packages as needed.
@ Job
Focus on installing the best version of the requested packages.
std::list< ResolverProblem_Ptr > ResolverProblemList
int compareByNVR(const Resolvable::constPtr &lhs, const Resolvable::constPtr &rhs)
relates: Resolvable Compare according to kind, name and edition.
std::unordered_set< Capability > CapabilitySet
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.
Select PoolItem by installed.
Select PoolItem by transact.
Select PoolItem by uninstalled.
bool isKind(const ResKind &kind_r) const
Solvable satSolvable() const
Return the corresponding sat::Solvable.
bool multiversionInstall() const
bool operator()(const PoolItem &p)
FindPackage(ProblemSolutionCombi *p, const TransactionKind act)
ProblemSolutionCombi * problemSolution
PoolItemList & _items_to_lock
SATCollectTransact(PoolItemList &items_to_install_r, PoolItemList &items_to_remove_r, PoolItemList &items_to_lock_r, PoolItemList &items_to_keep_r, bool solveSrcPackages_r)
PoolItemList & _items_to_install
PoolItemList & _items_to_remove
PoolItemList & _items_to_keep
bool operator()(const PoolItem &item_r)
Convenient building of std::string via std::ostringstream Basically a std::ostringstream autoconverti...
#define IMPL_PTR_TYPE(NAME)