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>
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();
249SATResolver::dumpOn( std::ostream & os )
const
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 , _dup_allowdowngrade ( ZConfig::instance().solver_dupAllowDowngrade() )
309 , _dup_allownamechange ( ZConfig::instance().solver_dupAllowNameChange() )
310 , _dup_allowarchchange ( ZConfig::instance().solver_dupAllowArchChange() )
311 , _dup_allowvendorchange ( ZConfig::instance().solver_dupAllowVendorChange() )
312 , _solveSrcPackages(false)
313 , _cleandepsOnRemove(ZConfig::instance().solver_cleandepsOnRemove())
318SATResolver::~SATResolver()
326SATResolver::pool (
void)
const
348 XDEBUG(
"SATSolutionToPool install returns " << item <<
", " << r);
352 XDEBUG(
"SATSolutionToPool upgrade returns " << item <<
", " << r);
356 XDEBUG(
"SATSolutionToPool remove returns " << item <<
", " << r);
377 PoolItemList & items_to_remove_r,
378 PoolItemList & items_to_lock_r,
379 PoolItemList & items_to_keep_r,
380 bool solveSrcPackages_r )
381 : _items_to_install( items_to_install_r )
382 , _items_to_remove( items_to_remove_r )
383 , _items_to_lock( items_to_lock_r )
384 , _items_to_keep( items_to_keep_r )
385 , _solveSrcPackages( solveSrcPackages_r )
387 _items_to_install.clear();
388 _items_to_remove.clear();
389 _items_to_lock.clear();
390 _items_to_keep.clear();
414 case ResStatus::TRANSACT:
415 itemStatus.
isUninstalled() ? _items_to_install.push_back( item_r )
416 : _items_to_remove.push_back( item_r );
break;
417 case ResStatus::LOCKED: _items_to_lock.push_back( item_r );
break;
418 case ResStatus::KEEP_STATE: _items_to_keep.push_back( item_r );
break;
434SATResolver::solverEnd()
439 solver_free(_satSolver);
441 queue_free( &(_jobQueue) );
446SATResolver::solverInit(
const PoolItemList & weakItems)
448 MIL <<
"SATResolver::solverInit()" << endl;
452 _satSolver = solver_create( _satPool );
453 queue_init( &_jobQueue );
458 bool toRelax =
false;
459 if ( _distupgrade ) {
461 if ( ! solv.isSystem() ) {
462 MIL <<
"Relaxed vendor check requested by " << solv << endl;
468 ::pool_set_custom_vendorcheck( _satPool, toRelax ? &relaxedVendorCheck : &
vendorCheck );
472 ::pool_add_userinstalled_jobs(_satPool,
sat::Pool::instance().autoInstalled(), &(_jobQueue), GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED);
477 SATCollectTransact collector( _items_to_install, _items_to_remove, _items_to_lock, _items_to_keep, solveSrcPackages() );
478 invokeOnEach ( _pool.begin(), _pool.end(), std::ref( collector ) );
482 for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
485 ERR <<
"Weaken: " << *iter <<
" not found" << endl;
487 MIL <<
"Weaken dependencies of " << *iter << endl;
488 queue_push( &(_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
489 queue_push( &(_jobQueue),
id );
494 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
496 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
503 const auto & trackedLocaleIds( myPool().trackedLocaleIds() );
506 for (
const auto & locale : trackedLocaleIds.added() )
508 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
512 for (
const auto & locale : trackedLocaleIds.removed() )
514 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES | SOLVER_CLEANDEPS );
520 for (
const sat::Solvable & solv : myPool().multiversionList() )
522 queue_push( &(_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
523 queue_push( &(_jobQueue), solv.id() );
532 if ( _protectPTFs ) {
533 for (
const auto & solv : sat::AllPTFs() ) {
534 if ( solv.isSystem() ) {
535 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
536 queue_push( &(_jobQueue), solv.id() );
543 solverInitSetSystemRequirements();
546 solverInitSetLocks();
549 solverInitSetModeJobsAndFlags();
552void SATResolver::solverInitSetSystemRequirements()
554 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
555 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
557 for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
558 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
559 queue_push( &(_jobQueue), iter->id() );
560 MIL <<
"SYSTEM Requires " << *iter << endl;
563 for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
564 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
565 queue_push( &(_jobQueue), iter->id() );
566 MIL <<
"SYSTEM Conflicts " << *iter << endl;
574 IdString rpm(
"rpm" );
575 for_( it, pool.byIdentBegin(rpm), pool.byIdentEnd(rpm) )
577 if ( (*it)->isSystem() )
580 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
581 queue_push( &(_jobQueue), archrule.id() );
588void SATResolver::solverInitSetLocks()
593 for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter != _items_to_lock.end(); ++iter) {
595 if (iter->status().isInstalled()) {
597 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
598 queue_push( &(_jobQueue),
id );
601 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
602 queue_push( &(_jobQueue),
id );
605 MIL <<
"Locked " << icnt <<
" installed items and " << acnt <<
" NOT installed items." << endl;
611 std::set<IdString> unifiedByName;
612 for (PoolItemList::const_iterator iter = _items_to_keep.begin(); iter != _items_to_keep.end(); ++iter) {
613 IdString ident( iter->ident() );
614 if ( unifiedByName.insert( ident ).second )
618 MIL <<
"Keep NOT installed name " << ident <<
" (" << *iter <<
")" << endl;
619 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | SOLVER_WEAK |
MAYBE_CLEANDEPS );
620 queue_push( &(_jobQueue), ident.id() );
626void SATResolver::solverInitSetModeJobsAndFlags()
629 queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
630 queue_push( &(_jobQueue), 0 );
633 queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
634 queue_push( &(_jobQueue), 0 );
637 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
638 queue_push( &(_jobQueue), 0 );
640 if (_removeOrphaned) {
641 queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
642 queue_push( &(_jobQueue), 0 );
645 solverSetFocus( *_satSolver, _focus );
646 solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
647 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
648 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
649 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
650 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange);
651 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
652 solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide);
653 solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
654 solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED,
false);
655 solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires);
656 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade );
657 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange );
658 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange );
659 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, _dup_allowvendorchange );
675 : is_updated( false )
676 , _installed( installed_r )
703 MIL <<
"Starting solving...." << endl;
705 if ( solver_solve( _satSolver, &(_jobQueue) ) == 0 )
712 if ( _removeOrphaned )
713 MIL <<
"Droplist processing not needed. RemoveUnsupported is On." << endl;
715 MIL <<
"Droplist processing is disabled in ZConfig." << endl;
718 bool resolve =
false;
719 MIL <<
"Checking droplists ..." << endl;
722 solver_get_decisionqueue( _satSolver, decisionq );
729 static const Capability productCap {
"product()" };
730 if ( slv && slv.provides().matches( productCap ) )
732 CapabilitySet droplist { slv.valuesOfNamespace(
"weakremover" ) };
733 MIL <<
"Droplist for " << slv <<
": size " << droplist.size() << endl;
734 if ( !droplist.empty() )
736 for (
const auto & cap : droplist )
738 queue_push( &_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
739 queue_push( &_jobQueue, cap.id() );
742 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
743 queue_push( &(_jobQueue),
id );
749 solver_solve( _satSolver, &(_jobQueue) );
753 MIL <<
"....Solver end" << endl;
757 _result_items_to_install.clear();
758 _result_items_to_remove.clear();
762 queue_init(&decisionq);
763 solver_get_decisionqueue(_satSolver, &decisionq);
764 for (
int i = 0; i < decisionq.count; ++i )
766 Id p = decisionq.elements[i];
771 if ( ! slv || slv.isSystem() )
774 PoolItem poolItem( slv );
776 _result_items_to_install.push_back( poolItem );
778 queue_free(&decisionq);
782 if ( systemRepo && ! systemRepo.solvablesEmpty() )
784 bool mustCheckObsoletes =
false;
785 for_( it, systemRepo.solvablesBegin(), systemRepo.solvablesEnd() )
787 if (solver_get_decisionlevel(_satSolver, it->id()) > 0)
791 CheckIfUpdate info( *it );
792 PoolItem poolItem( *it );
794 _pool.byIdentEnd( poolItem ),
795 resfilter::ByUninstalled(),
798 if (info.is_updated) {
802 if ( ! mustCheckObsoletes )
803 mustCheckObsoletes =
true;
805 _result_items_to_remove.push_back (poolItem);
807 if ( mustCheckObsoletes )
809 sat::WhatObsoletes obsoleted( _result_items_to_install.begin(), _result_items_to_install.end() );
810 for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
812 ResStatus & status( it->status() );
814 if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
815 status.setToBeUninstalledDueToObsolete();
822 solverCopyBackWeak( *_satSolver, _problem_items );
823 solverCopyBackValidate( *_satSolver, _pool );
828 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
829 sat::WhatProvides rpmProviders(*iter);
830 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
831 PoolItem poolItem(*iter2);
832 if (poolItem.status().isToBeInstalled()) {
833 MIL <<
"User requirement " << *iter <<
" sets " << poolItem << endl;
838 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
839 sat::WhatProvides rpmProviders(*iter);
840 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
841 PoolItem poolItem(*iter2);
842 if (poolItem.status().isToBeUninstalled()) {
843 MIL <<
"User conflict " << *iter <<
" sets " << poolItem << endl;
849 if (solver_problem_count(_satSolver) > 0 )
851 ERR <<
"Solverrun finished with an ERROR" << endl;
858void SATResolver::solverAddJobsFromPool()
860 for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
863 ERR <<
"Install: " << *iter <<
" not found" << endl;
865 MIL <<
"Install " << *iter << endl;
866 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
867 queue_push( &(_jobQueue),
id );
871 for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
874 ERR <<
"Delete: " << *iter <<
" not found" << endl;
876 MIL <<
"Delete " << *iter << endl;
877 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
878 queue_push( &(_jobQueue),
id);
885 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
886 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
887 queue_push( &(_jobQueue), iter->id() );
888 MIL <<
"Requires " << *iter << endl;
891 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
892 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
893 queue_push( &(_jobQueue), iter->id() );
894 MIL <<
"Conflicts " << *iter << endl;
901 const PoolItemList & weakItems,
902 const std::set<Repository> & upgradeRepos)
904 MIL <<
"SATResolver::resolvePool()" << endl;
907 solverInit(weakItems);
910 solverAddJobsFromPool();
911 solverAddJobsFromExtraQueues( requires_caps, conflict_caps );
913 for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
915 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
916 queue_push( &(_jobQueue), iter->get()->repoid );
917 MIL <<
"Upgrade repo " << *iter << endl;
921 bool ret = solving(requires_caps, conflict_caps);
923 (ret?
MIL:
WAR) <<
"SATResolver::resolvePool() done. Ret:" << ret << endl;
929SATResolver::resolveQueue(
const SolverQueueItemList &requestQueue,
930 const PoolItemList & weakItems)
932 MIL <<
"SATResolver::resolvQueue()" << endl;
935 solverInit(weakItems);
938 for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
939 (*iter)->addRule(_jobQueue);
943 solverAddJobsFromPool();
946 bool ret = solving();
948 (ret?
MIL:
WAR) <<
"SATResolver::resolveQueue() done. Ret:" << ret << endl;
953void SATResolver::doUpdate()
955 MIL <<
"SATResolver::doUpdate()" << endl;
958 solverInit(PoolItemList());
968 MIL <<
"Starting solving for update...." << endl;
970 solver_solve( _satSolver, &(_jobQueue) );
971 MIL <<
"....Solver end" << endl;
978 queue_init(&decisionq);
979 solver_get_decisionqueue(_satSolver, &decisionq);
980 for (
int i = 0; i < decisionq.count; i++)
982 Id p = decisionq.elements[i];
987 if ( ! solv || solv.isSystem() )
992 queue_free(&decisionq);
995 if ( _satSolver->pool->installed ) {
996 for (
int i = _satSolver->pool->installed->start; i < _satSolver->pool->installed->start + _satSolver->pool->installed->nsolvables; i++)
998 if (solver_get_decisionlevel(_satSolver, i) > 0)
1001 PoolItem poolItem( _pool.find( sat::Solvable(i) ) );
1004 CheckIfUpdate info( (sat::Solvable(i)) );
1006 _pool.byIdentEnd( poolItem ),
1007 resfilter::ByUninstalled(),
1010 if (info.is_updated) {
1016 ERR <<
"id " << i <<
" not found in ZYPP pool." << endl;
1023 solverCopyBackWeak( *_satSolver, _problem_items );
1024 solverCopyBackValidate( *_satSolver, _pool );
1026 MIL <<
"SATResolver::doUpdate() done" << endl;
1046 : problemSolution (p)
1053 problemSolution->addSingleAction (p, action);
1081{
return PoolItem( mapBuddy( item ) ); }
1086std::vector<std::string> SATResolver::SATgetCompleteProblemInfoStrings ( Id problem )
1088 std::vector<std::string> ret;
1089 sat::Queue problems;
1090 solver_findallproblemrules( _satSolver, problem, problems );
1096 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1097 if ( ruleClass != SolverRuleinfo::SOLVER_RULE_UPDATE && ruleClass != SolverRuleinfo::SOLVER_RULE_JOB ) {
1103 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1104 if ( nobad && ( ruleClass == SolverRuleinfo::SOLVER_RULE_UPDATE || ruleClass == SolverRuleinfo::SOLVER_RULE_JOB ) ) {
1110 std::string pInfo = SATproblemRuleInfoString( problems[i], detail, ignore );
1113 if ( std::find( ret.begin(), ret.end(), pInfo ) == ret.end() )
1114 ret.push_back( pInfo );
1119std::string SATResolver::SATprobleminfoString(Id problem, std::string &detail, Id &ignoreId)
1123 Id probr = solver_findproblemrule(_satSolver, problem);
1124 return SATproblemRuleInfoString( probr, detail, ignoreId );
1127std::string SATResolver::SATproblemRuleInfoString (Id probr, std::string &detail, Id &ignoreId)
1131 Id dep = 0, source = 0, target = 0;
1132 SolverRuleinfo type = solver_ruleinfo(_satSolver, probr, &source, &target, &dep);
1136 sat::Solvable s = mapSolvable( source );
1137 sat::Solvable s2 = mapSolvable( target );
1144 case SOLVER_RULE_DISTUPGRADE:
1146 ret = str::Format(
_(
"the installed %1% does not belong to a distupgrade repository and must be replaced") ) % s.asString();
1148 ret = str::Format(
_(
"the to be installed %1% does not belong to a distupgrade repository") ) % s.asString();
1150 case SOLVER_RULE_INFARCH:
1152 ret = str::Format(
_(
"the installed %1% has inferior architecture") ) % s.asString();
1154 ret = str::Format(
_(
"the to be installed %1% has inferior architecture") ) % s.asString();
1156 case SOLVER_RULE_UPDATE:
1157 ret = str::Format(
_(
"problem with the installed %1%") ) % s.asString();
1159 case SOLVER_RULE_JOB:
1160 ret =
_(
"conflicting requests");
1162 case SOLVER_RULE_PKG:
1163 ret =
_(
"some dependency problem");
1165 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1166 ret = str::Format(
_(
"nothing provides the requested '%1%'") ) % pool_dep2str(pool, dep);
1167 detail +=
_(
"Have you enabled all the required repositories?");
1169 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1170 ret = str::Format(
_(
"the requested package %1% does not exist") ) % pool_dep2str(pool, dep);
1171 detail +=
_(
"Have you enabled all the required repositories?");
1173 case SOLVER_RULE_JOB_UNSUPPORTED:
1174 ret =
_(
"unsupported request");
1176 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1177 ret = str::Format(
_(
"'%1%' is provided by the system and cannot be erased") ) % pool_dep2str(pool, dep);
1179 case SOLVER_RULE_PKG_NOT_INSTALLABLE:
1180 ret = str::Format(
_(
"%1% is not installable") ) % s.asString();
1182 case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
1185 ret = str::Format(
_(
"nothing provides '%1%' needed by the installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1187 ret = str::Format(
_(
"nothing provides '%1%' needed by the to be installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1189 case SOLVER_RULE_PKG_SAME_NAME:
1190 ret = str::Format(
_(
"cannot install both %1% and %2%") ) % s.asString() % s2.asString();
1192 case SOLVER_RULE_PKG_CONFLICTS:
1193 if ( s.isSystem() ) {
1194 if ( s2.isSystem() )
1195 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1197 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1200 if ( s2.isSystem() )
1201 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1203 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();
1206 case SOLVER_RULE_PKG_OBSOLETES:
1207 case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
1208 if ( s.isSystem() ) {
1209 if ( s2.isSystem() )
1210 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1212 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1215 if ( s2.isSystem() )
1216 ret = str::Format(
_(
"the to be installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1218 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();
1221 case SOLVER_RULE_PKG_SELF_CONFLICT:
1223 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1225 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1227 case SOLVER_RULE_PKG_REQUIRES: {
1229 Capability cap(dep);
1230 sat::WhatProvides possibleProviders(cap);
1233 typedef std::list<PoolItem> ProviderList;
1234 ProviderList providerlistInstalled, providerlistUninstalled;
1235 for_( iter1, possibleProviders.begin(), possibleProviders.end() ) {
1239 for_( iter2, possibleProviders.begin(), possibleProviders.end() ) {
1241 if (compareByNVR (provider1,provider2) == 0
1242 && ( (provider1.status().isInstalled() && provider2.status().isUninstalled())
1243 || (provider2.status().isInstalled() && provider1.status().isUninstalled()) )) {
1249 if (provider1.status().isInstalled())
1250 providerlistInstalled.push_back(provider1);
1252 providerlistUninstalled.push_back(provider1);
1257 ret = str::Format(
_(
"the installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1259 ret = str::Format(
_(
"the to be installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1260 if (providerlistInstalled.size() > 0) {
1261 detail +=
_(
"deleted providers: ");
1262 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1263 if (iter == providerlistInstalled.begin())
1269 if (providerlistUninstalled.size() > 0) {
1270 if (detail.size() > 0)
1271 detail +=
_(
"\nnot installable providers: ");
1273 detail =
_(
"not installable providers: ");
1274 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1275 if (iter == providerlistUninstalled.begin())
1284 DBG <<
"Unknown rule type(" << type <<
") going to query libsolv for rule information." << endl;
1285 ret =
str::asString( ::solver_problemruleinfo2str( _satSolver, type,
static_cast<Id
>(s.id()),
static_cast<Id
>(s2.id()), dep ) );
1297 void notInstallPatch( sat::Solvable slv_r )
1298 {
_patch.push_back( slv_r.ident() ); }
1300 void removePtf( sat::Solvable slv_r,
bool showremoveProtectHint_r =
false )
1303 bool applies()
const
1304 {
return not
_ptf.empty(); }
1306 std::string description()
const {
1307 if ( not
_patch.empty() ) {
1310 << (str::Format(
_(
"%1% is not yet fully integrated into %2%.") ) % printlist(
_ptf) % printlist(
_patch)) << endl
1311 <<
_(
"Typically you want to keep the PTF and choose to not install the maintenance patches.");
1316 const std::string & removeptfCommand { str::Format(
"zypper removeptf %1%") % printlist(
_ptf) };
1319 << (str::Format(
_(
"Removing the installed %1% in this context will remove (not replace!) the included PTF-packages too." ) ) % printlist(
_ptf)) << endl
1320 << (str::Format(
_(
"The PTF should be removed by calling '%1%'. This will update the included PTF-packages rather than removing them." ) ) % removeptfCommand) << endl
1321 <<
_(
"Typically you want to keep the PTF or choose to cancel the action.");
1326 << (str::Format(
_(
"The installed %1% blocks the desired action.") ) % printlist(
_ptf)) << endl
1327 <<
_(
"Typically you want to keep the PTF and choose to cancel the action.");
1330 using StoreType = IdString;
1331 static std::string printlist(
const std::vector<StoreType> & list_r )
1332 { str::Str ret;
dumpRange( ret.stream(), list_r.begin(), list_r.end(),
"",
"",
", ",
"",
"" );
return ret; }
1342SATResolver::problems ()
1345 if (_satSolver && solver_problem_count(_satSolver)) {
1348 Id p = 0, rp = 0, what = 0;
1349 Id problem = 0, solution = 0, element = 0;
1350 sat::Solvable s, sd;
1352 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1353 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1355 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1358 while ((problem = solver_next_problem(_satSolver, problem)) != 0) {
1359 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1360 MIL <<
"====================================" << endl;
1363 std::string whatString = SATprobleminfoString (problem,detail,ignoreId);
1364 MIL << whatString << endl;
1365 MIL <<
"------------------------------------" << endl;
1366 ResolverProblem_Ptr resolverProblem =
new ResolverProblem (whatString, detail, SATgetCompleteProblemInfoStrings( problem ));
1367 PtfPatchHint ptfPatchHint;
1369 while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
1371 ProblemSolutionCombi *problemSolution =
new ProblemSolutionCombi;
1372 while ((element = solver_next_solutionelement(_satSolver, problem, solution, element, &p, &rp)) != 0) {
1373 if (p == SOLVER_SOLUTION_JOB) {
1375 what = _jobQueue.elements[rp];
1376 switch (_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1378 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1379 s = mapSolvable (what);
1380 PoolItem poolItem = _pool.find (s);
1382 if (pool->installed && s.get()->repo == pool->installed) {
1383 problemSolution->addSingleAction (poolItem, REMOVE);
1384 std::string description = str::Format(
_(
"remove lock to allow removal of %1%") ) % s.asString();
1385 MIL << description << endl;
1386 problemSolution->addDescription (description);
1387 if ( _protectPTFs && s.isPtfMaster() )
1388 ptfPatchHint.removePtf( s, _protectPTFs );
1390 problemSolution->addSingleAction (poolItem, KEEP);
1391 std::string description = str::Format(
_(
"do not install %1%") ) % s.asString();
1392 MIL << description << endl;
1393 problemSolution->addDescription (description);
1394 if ( s.isKind<Patch>() )
1395 ptfPatchHint.notInstallPatch( s );
1398 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.asString() << endl;
1402 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1403 s = mapSolvable (what);
1404 PoolItem poolItem = _pool.find (s);
1406 if (pool->installed && s.get()->repo == pool->installed) {
1407 problemSolution->addSingleAction (poolItem, KEEP);
1408 std::string description = str::Format(
_(
"keep %1%") ) % s.asString();
1409 MIL << description << endl;
1410 problemSolution->addDescription (description);
1412 problemSolution->addSingleAction (poolItem, UNLOCK);
1413 std::string description = str::Format(
_(
"remove lock to allow installation of %1%") ) %
itemToString( poolItem );
1414 MIL << description << endl;
1415 problemSolution->addDescription (description);
1418 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.asString() << endl;
1422 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1424 IdString ident( what );
1425 SolverQueueItemInstall_Ptr install =
1426 new SolverQueueItemInstall(_pool, ident.asString(),
false );
1427 problemSolution->addSingleAction (install, REMOVE_SOLVE_QUEUE_ITEM);
1429 std::string description = str::Format(
_(
"do not install %1%") ) % ident;
1430 MIL << description << endl;
1431 problemSolution->addDescription (description);
1434 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1438 IdString ident( what );
1439 FindPackage info (problemSolution, KEEP);
1441 _pool.byIdentEnd( ident ),
1443 resfilter::ByTransact ()),
1446 SolverQueueItemDelete_Ptr del =
1447 new SolverQueueItemDelete(_pool, ident.asString(),
false );
1448 problemSolution->addSingleAction (del, REMOVE_SOLVE_QUEUE_ITEM);
1450 std::string description = str::Format(
_(
"keep %1%") ) % ident;
1451 MIL << description << endl;
1452 problemSolution->addDescription (description);
1455 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1457 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_REQUIRE);
1458 std::string description =
"";
1461 if (system_requires.find(Capability(what)) != system_requires.end()) {
1463 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1464 resolverProblem->setDescription(
_(
"This request will break your system!"));
1465 description =
_(
"ignore the warning of a broken system");
1466 description += std::string(
" (requires:")+pool_dep2str(pool, what)+
")";
1467 MIL << description << endl;
1468 problemSolution->addFrontDescription (description);
1470 description = str::Format(
_(
"do not ask to install a solvable providing %1%") ) % pool_dep2str(pool, what);
1471 MIL << description << endl;
1472 problemSolution->addDescription (description);
1476 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1478 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_CONFLICT);
1479 std::string description =
"";
1482 if (system_conflicts.find(Capability(what)) != system_conflicts.end()) {
1484 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1485 resolverProblem->setDescription(
_(
"This request will break your system!"));
1486 description =
_(
"ignore the warning of a broken system");
1487 description += std::string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1488 MIL << description << endl;
1489 problemSolution->addFrontDescription (description);
1492 description = str::Format(
_(
"do not ask to delete all solvables providing %1%") ) % pool_dep2str(pool, what);
1493 MIL << description << endl;
1494 problemSolution->addDescription (description);
1498 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1500 s = mapSolvable (what);
1501 PoolItem poolItem = _pool.find (s);
1503 if (pool->installed && s.get()->repo == pool->installed) {
1504 problemSolution->addSingleAction (poolItem, KEEP);
1505 std::string description = str::Format(
_(
"do not install most recent version of %1%") ) % s.asString();
1506 MIL << description << endl;
1507 problemSolution->addDescription (description);
1509 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1512 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.asString() << endl;
1517 MIL <<
"- do something different" << endl;
1518 ERR <<
"No valid solution available" << endl;
1521 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1522 s = mapSolvable (rp);
1523 PoolItem poolItem = _pool.find (s);
1524 if (pool->installed && s.get()->repo == pool->installed) {
1525 problemSolution->addSingleAction (poolItem, LOCK);
1526 std::string description = str::Format(
_(
"keep %1% despite the inferior architecture") ) % s.asString();
1527 MIL << description << endl;
1528 problemSolution->addDescription (description);
1530 problemSolution->addSingleAction (poolItem, INSTALL);
1531 std::string description = str::Format(
_(
"install %1% despite the inferior architecture") ) % s.asString();
1532 MIL << description << endl;
1533 problemSolution->addDescription (description);
1535 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
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 obsolete %1%") ) % s.asString();
1541 MIL << description << endl;
1542 problemSolution->addDescription (description);
1544 problemSolution->addSingleAction (poolItem, INSTALL);
1545 std::string description = str::Format(
_(
"install %1% from excluded repository") ) % s.asString();
1546 MIL << description << endl;
1547 problemSolution->addDescription (description);
1549 }
else if ( p == SOLVER_SOLUTION_BLACK ) {
1552 s = mapSolvable (rp);
1553 PoolItem poolItem = _pool.find (s);
1555 problemSolution->addSingleAction (poolItem, INSTALL);
1556 std::string description;
1557 if ( s.isRetracted() ) {
1559 description = str::Format(
_(
"install %1% although it has been retracted")) % s.asString();
1560 }
else if ( s.isPtf() ) {
1562 description = str::Format(
_(
"allow installing the PTF %1%")) % s.asString();
1565 description = str::Format(
_(
"install %1% although it is blacklisted")) % s.asString();
1567 MIL << description << endl;
1568 problemSolution->addDescription( description );
1569 }
else if ( p > 0 ) {
1571 s = mapSolvable (p);
1572 PoolItem itemFrom = _pool.find (s);
1577 sd = mapSolvable (rp);
1578 PoolItem itemTo = _pool.find (sd);
1579 if (itemFrom && itemTo) {
1580 problemSolution->addSingleAction (itemTo, INSTALL);
1581 int illegal = policy_is_illegal(_satSolver, s.get(), sd.get(), 0);
1583 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1585 std::string description = str::Format(
_(
"downgrade of %1% to %2%") ) % s.asString() % sd.asString();
1586 MIL << description << endl;
1587 problemSolution->addDescription (description);
1590 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1592 std::string description = str::Format(
_(
"architecture change of %1% to %2%") ) % s.asString() % sd.asString();
1593 MIL << description << endl;
1594 problemSolution->addDescription (description);
1597 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1599 IdString s_vendor( s.vendor() );
1600 IdString sd_vendor( sd.vendor() );
1601 std::string description;
1603 description = str::Format(
_(
"install %1% (with vendor change)\n %2% --> %3%") )
1605 % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " )
1606 % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " );
1608 description = str::Format(
_(
"install %1% from vendor %2%\n replacing %3% from vendor %4%") )
1609 % sd.asString() % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " )
1610 % s.asString() % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " );
1612 MIL << description << endl;
1613 problemSolution->addDescription (description);
1617 std::string description = str::Format(
_(
"replacement of %1% with %2%") ) % s.asString() % sd.asString();
1618 MIL << description << endl;
1619 problemSolution->addDescription (description);
1622 ERR << s.asString() <<
" or " << sd.asString() <<
" not found" << endl;
1628 std::string description = str::Format(
_(
"deinstallation of %1%") ) % s.asString();
1629 MIL << description << endl;
1630 problemSolution->addDescription (description);
1631 problemSolution->addSingleAction (itemFrom, REMOVE);
1632 if ( s.isPtfMaster() )
1633 ptfPatchHint.removePtf( s );
1639 INT <<
"Unknown solution " << p << endl;
1643 resolverProblem->addSolution (problemSolution,
1644 problemSolution->actionCount() > 1 ?
true :
false);
1645 MIL <<
"------------------------------------" << endl;
1650 PoolItem item = _pool.find (sat::Solvable(ignoreId));
1651 ProblemSolutionIgnore *problemSolution =
new ProblemSolutionIgnore(item);
1652 resolverProblem->addSolution (problemSolution,
1654 MIL <<
"ignore some dependencies of " << item << endl;
1655 MIL <<
"------------------------------------" << endl;
1659 if ( ptfPatchHint.applies() ) {
1660 resolverProblem->setDescription( str::Str() << ptfPatchHint.description() << endl <<
"(" << resolverProblem->description() <<
")" );
1663 resolverProblems.push_back (resolverProblem);
1666 return resolverProblems;
1670{ Resolver( _pool ).applySolutions( solutions ); }
1676 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
1684 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES );
std::vector< StoreType > _ptf
std::vector< StoreType > _patch
bool _showremoveProtectHint
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Access to the sat-pools string space.
Combining sat::Solvable and ResStatus.
ResStatus & status() const
Returns the current status.
sat::Solvable buddy() const
Return the buddy we share our status object with.
std::string alias() const
Short unique string to identify a repo.
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
static ResPool instance()
Singleton ctor.
static const ResStatus toBeInstalled
bool setToBeUninstalled(TransactByValue causer)
bool isToBeInstalled() const
bool setToBeInstalled(TransactByValue causer)
TransactValue getTransactValue() const
static const ResStatus toBeUninstalledDueToUpgrade
static const ResStatus toBeUninstalled
bool isToBeUninstalled() const
bool isToBeUninstalledDueToUpgrade() const
bool resetTransact(TransactByValue causer_r)
Not the same as setTransact( false ).
bool setToBeUninstalledDueToUpgrade(TransactByValue causer)
bool isUninstalled() const
bool equivalent(const Vendor &lVendor, const Vendor &rVendor) const
Return whether two vendor strings should be treated as the same vendor.
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()
Repository repository() const
The Repository this Solvable belongs to.
bool operator()(const PoolItem &item)
CheckIfUpdate(const sat::Solvable &installed_r)
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
Chain< TACondition, TBCondition > chain(TACondition conda_r, TBCondition condb_r)
Convenience function for creating a Chain from two conditions conda_r and condb_r.
unsigned int SolvableIdType
Id type to connect Solvable and sat-solvable.
int IdType
Generic Id type.
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
::s_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
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::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).
ResolverFocus
The resolver's general attitude.
@ Update
Focus on updating requested packages and their dependencies as much as possible.
@ Default
Request the standard behavior (as defined in zypp.conf or 'Job')
@ Installed
Focus on applying as little changes to the installed packages as needed.
@ Job
Focus on installing the best version of the requested packages.
std::list< ProblemSolution_Ptr > ProblemSolutionList
std::unordered_set< Capability > CapabilitySet
std::list< ResolverProblem_Ptr > ResolverProblemList
int invokeOnEach(TIterator begin_r, TIterator end_r, TFilter filter_r, TFunction fnc_r)
Iterate through [begin_r,end_r) and invoke fnc_r on each item that passes filter_r.
bool isKind(const ResKind &kind_r) const
Solvable satSolvable() const
Return the corresponding sat::Solvable.
bool multiversionInstall() const
bool operator()(const PoolItem &p)
FindPackage(ProblemSolutionCombi *p, const TransactionKind act)
ProblemSolutionCombi * problemSolution
Commit helper functor distributing PoolItem by status into lists.
PoolItemList & _items_to_lock
SATCollectTransact(PoolItemList &items_to_install_r, PoolItemList &items_to_remove_r, PoolItemList &items_to_lock_r, PoolItemList &items_to_keep_r, bool solveSrcPackages_r)
PoolItemList & _items_to_install
PoolItemList & _items_to_remove
PoolItemList & _items_to_keep
bool operator()(const PoolItem &item_r)
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
#define IMPL_PTR_TYPE(NAME)