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>
58 #define XDEBUG(x) do { if (base::logger::isExcessive()) XXX << x << std::endl;} while (0)
60 #undef ZYPP_BASE_LOGGER_LOGGROUP
61 #define ZYPP_BASE_LOGGER_LOGGROUP "zypp::solver"
82 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
83 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
86 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 1 );
87 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 0 );
90 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_INSTALLED, 0 );
91 solver_set_flag( &satSolver_r, SOLVER_FLAG_FOCUS_BEST, 1 );
99 inline sat::Queue collectPseudoInstalled(
const ResPool & pool_r )
102 for (
const PoolItem & pi : pool_r )
110 inline void solverCopyBackWeak(
sat::detail::CSolver & satSolver_r, PoolItemList & orphanedItems_r )
114 sat::Queue recommendations;
115 sat::Queue suggestions;
116 ::solver_get_recommendations( &satSolver_r, recommendations, suggestions, 0 );
118 PoolItem(sat::Solvable(recommendations[i])).status().setRecommended(
true );
120 PoolItem(sat::Solvable(suggestions[i])).status().setSuggested(
true );
123 orphanedItems_r.clear();
125 ::solver_get_orphaned( &satSolver_r, orphaned );
128 PoolItem pi { sat::Solvable(orphaned[i]) };
129 pi.status().setOrphaned(
true );
130 orphanedItems_r.push_back( pi );
135 ::solver_get_unneeded( &satSolver_r, unneeded, 1 );
137 PoolItem(sat::Solvable(unneeded[i])).status().setUnneeded(
true );
142 inline void solverCopyBackValidate(
sat::detail::CSolver & satSolver_r,
const ResPool & pool_r )
144 sat::Queue pseudoItems { collectPseudoInstalled( pool_r ) };
145 if ( ! pseudoItems.empty() )
147 sat::Queue pseudoFlags;
148 ::solver_trivial_installable( &satSolver_r, pseudoItems, pseudoFlags );
152 PoolItem pi { sat::Solvable(pseudoItems[i]) };
153 switch ( pseudoFlags[i] )
155 case 0: pi.status().setBroken();
break;
156 case 1: pi.status().setSatisfied();
break;
157 case -1: pi.status().setNonRelevant();
break;
158 default: pi.status().setUndetermined();
break;
171 #define MAYBE_CLEANDEPS (cleandepsOnRemove()?SOLVER_CLEANDEPS:0)
190 if ( ! pseudoItems_r.
empty() )
192 MIL <<
"Establish..." << endl;
194 ::pool_set_custom_vendorcheck( cPool, &
vendorCheck );
200 jobQueue.
push( SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
201 jobQueue.
push( solv.id() );
206 if ( ::solver_solve( cSolver, jobQueue ) != 0 )
207 INT <<
"How can establish fail?" << endl;
209 ::solver_trivial_installable( cSolver, pseudoItems_r, pseudoFlags_r );
214 switch ( pseudoFlags_r[i] )
216 case 0: pi.status().setBroken();
break;
217 case 1: pi.status().setSatisfied();
break;
218 case -1: pi.status().setNonRelevant();
break;
219 default: pi.status().setUndetermined();
break;
222 MIL <<
"Establish DONE" << endl;
225 MIL <<
"Establish not needed." << endl;
231 return std::string();
249 os <<
"<resolver>" << endl;
251 #define OUTS(X) os << " " << #X << "\t= " << solver_get_flag(_satSolver, SOLVER_FLAG_##X) << endl
252 OUTS( ALLOW_DOWNGRADE );
253 OUTS( ALLOW_ARCHCHANGE );
254 OUTS( ALLOW_VENDORCHANGE );
255 OUTS( ALLOW_NAMECHANGE );
256 OUTS( ALLOW_UNINSTALL );
257 OUTS( NO_UPDATEPROVIDE );
258 OUTS( SPLITPROVIDES );
259 OUTS( IGNORE_RECOMMENDED );
260 OUTS( ADD_ALREADY_RECOMMENDED );
261 OUTS( NO_INFARCHCHECK );
262 OUTS( KEEP_EXPLICIT_OBSOLETES );
263 OUTS( BEST_OBEY_POLICY );
264 OUTS( NO_AUTOTARGET );
265 OUTS( DUP_ALLOW_DOWNGRADE );
266 OUTS( DUP_ALLOW_ARCHCHANGE );
267 OUTS( DUP_ALLOW_VENDORCHANGE );
268 OUTS( DUP_ALLOW_NAMECHANGE );
269 OUTS( KEEP_ORPHANS );
270 OUTS( BREAK_ORPHANS );
271 OUTS( YUM_OBSOLETES );
273 os <<
" focus = " << _focus << endl;
274 os <<
" distupgrade = " << _distupgrade << endl;
275 os <<
" distupgrade_removeunsupported = " << _distupgrade_removeunsupported << endl;
276 os <<
" solveSrcPackages = " << _solveSrcPackages << endl;
277 os <<
" cleandepsOnRemove = " << _cleandepsOnRemove << endl;
278 os <<
" fixsystem = " << _fixsystem << endl;
282 return os <<
"<resolver/>" << endl;
292 , _focus ( ZConfig::instance().solver_focus() )
294 , _allowdowngrade ( false )
295 , _allownamechange ( true )
296 , _allowarchchange ( false )
297 , _allowvendorchange ( ZConfig::instance().solver_allowVendorChange() )
298 , _allowuninstall ( false )
299 , _updatesystem(false)
300 , _noupdateprovide ( false )
301 , _dosplitprovides ( true )
302 , _onlyRequires (ZConfig::instance().solver_onlyRequires())
303 , _ignorealreadyrecommended(true)
304 , _distupgrade(false)
305 , _distupgrade_removeunsupported(false)
306 , _dup_allowdowngrade ( ZConfig::instance().solver_dupAllowDowngrade() )
307 , _dup_allownamechange ( ZConfig::instance().solver_dupAllowNameChange() )
308 , _dup_allowarchchange ( ZConfig::instance().solver_dupAllowArchChange() )
309 , _dup_allowvendorchange ( ZConfig::instance().solver_dupAllowVendorChange() )
310 , _solveSrcPackages(false)
311 , _cleandepsOnRemove(ZConfig::instance().solver_cleandepsOnRemove())
316 SATResolver::~SATResolver()
324 SATResolver::pool (
void)
const
346 XDEBUG(
"SATSolutionToPool install returns " << item <<
", " << r);
350 XDEBUG(
"SATSolutionToPool upgrade returns " << item <<
", " << r);
354 XDEBUG(
"SATSolutionToPool remove returns " << item <<
", " << r);
375 PoolItemList & items_to_remove_r,
376 PoolItemList & items_to_lock_r,
377 PoolItemList & items_to_keep_r,
378 bool solveSrcPackages_r )
379 : _items_to_install( items_to_install_r )
380 , _items_to_remove( items_to_remove_r )
381 , _items_to_lock( items_to_lock_r )
382 , _items_to_keep( items_to_keep_r )
383 , _solveSrcPackages( solveSrcPackages_r )
385 _items_to_install.clear();
386 _items_to_remove.clear();
387 _items_to_lock.clear();
388 _items_to_keep.clear();
413 itemStatus.
isUninstalled() ? _items_to_install.push_back( item_r )
414 : _items_to_remove.push_back( item_r );
break;
446 : is_updated( false )
447 , _installed( installed_r )
472 queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
473 queue_push( &(_jobQueue), 0 );
476 queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
477 queue_push( &(_jobQueue), 0 );
480 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
481 queue_push( &(_jobQueue), 0 );
483 if (_distupgrade_removeunsupported) {
484 queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
485 queue_push( &(_jobQueue), 0 );
487 solverSetFocus( *_satSolver, _focus );
488 solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
489 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
490 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
491 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
492 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange);
493 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
494 solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide);
495 solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
496 solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED,
false);
497 solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires);
498 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_DOWNGRADE, _dup_allowdowngrade );
499 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_NAMECHANGE, _dup_allownamechange );
500 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE, _dup_allowarchchange );
501 solver_set_flag(_satSolver, SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE, _dup_allowvendorchange );
506 MIL <<
"Starting solving...." << endl;
508 if ( solver_solve( _satSolver, &(_jobQueue) ) == 0 )
515 if ( _distupgrade_removeunsupported )
516 MIL <<
"Droplist processing not needed. RemoveUnsupported is On." << endl;
518 MIL <<
"Droplist processing is disabled in ZConfig." << endl;
521 bool resolve =
false;
522 MIL <<
"Checking droplists ..." << endl;
525 solver_get_decisionqueue( _satSolver, decisionq );
532 static const Capability productCap {
"product()" };
533 if ( slv && slv.provides().matches( productCap ) )
535 CapabilitySet droplist { slv.valuesOfNamespace(
"weakremover" ) };
536 MIL <<
"Droplist for " << slv <<
": size " << droplist.size() << endl;
537 if ( !droplist.empty() )
539 for (
const auto & cap : droplist )
541 queue_push( &_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
542 queue_push( &_jobQueue, cap.id() );
545 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
546 queue_push( &(_jobQueue),
id );
552 solver_solve( _satSolver, &(_jobQueue) );
556 MIL <<
"....Solver end" << endl;
560 _result_items_to_install.clear();
561 _result_items_to_remove.clear();
565 queue_init(&decisionq);
566 solver_get_decisionqueue(_satSolver, &decisionq);
567 for (
int i = 0; i < decisionq.count; ++i )
569 Id p = decisionq.elements[i];
574 if ( ! slv || slv.isSystem() )
577 PoolItem poolItem( slv );
579 _result_items_to_install.push_back( poolItem );
581 queue_free(&decisionq);
585 if ( systemRepo && ! systemRepo.solvablesEmpty() )
587 bool mustCheckObsoletes =
false;
588 for_( it, systemRepo.solvablesBegin(), systemRepo.solvablesEnd() )
590 if (solver_get_decisionlevel(_satSolver, it->id()) > 0)
594 CheckIfUpdate info( *it );
595 PoolItem poolItem( *it );
597 _pool.byIdentEnd( poolItem ),
598 resfilter::ByUninstalled(),
599 functor::functorRef<bool,PoolItem> (info) );
601 if (info.is_updated) {
605 if ( ! mustCheckObsoletes )
606 mustCheckObsoletes =
true;
608 _result_items_to_remove.push_back (poolItem);
610 if ( mustCheckObsoletes )
612 sat::WhatObsoletes obsoleted( _result_items_to_install.begin(), _result_items_to_install.end() );
613 for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
615 ResStatus & status( it->status() );
617 if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
618 status.setToBeUninstalledDueToObsolete();
625 solverCopyBackWeak( *_satSolver, _problem_items );
626 solverCopyBackValidate( *_satSolver, _pool );
631 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
632 sat::WhatProvides rpmProviders(*iter);
633 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
634 PoolItem poolItem(*iter2);
635 if (poolItem.status().isToBeInstalled()) {
636 MIL <<
"User requirement " << *iter <<
" sets " << poolItem << endl;
641 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
642 sat::WhatProvides rpmProviders(*iter);
643 for_( iter2, rpmProviders.begin(), rpmProviders.end() ) {
644 PoolItem poolItem(*iter2);
645 if (poolItem.status().isToBeUninstalled()) {
646 MIL <<
"User conflict " << *iter <<
" sets " << poolItem << endl;
652 if (solver_problem_count(_satSolver) > 0 )
654 ERR <<
"Solverrun finished with an ERROR" << endl;
663 SATResolver::solverInit(
const PoolItemList & weakItems)
666 MIL <<
"SATResolver::solverInit()" << endl;
670 _satSolver = solver_create( _satPool );
674 bool toRelax =
false;
675 if ( _distupgrade ) {
676 for ( sat::Solvable solv : sat::WhatProvides( Capability(
"dup-vendor-relax(suse)") ) ) {
677 if ( ! solv.isSystem() ) {
678 MIL <<
"Relaxed vendor check requested by " << solv << endl;
687 queue_init( &_jobQueue );
691 SATCollectTransact collector( _items_to_install, _items_to_remove, _items_to_lock, _items_to_keep, solveSrcPackages() );
692 invokeOnEach ( _pool.begin(), _pool.end(), functor::functorRef<bool,PoolItem>( collector ) );
695 for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
698 ERR <<
"Weaken: " << *iter <<
" not found" << endl;
700 MIL <<
"Weaken dependencies of " << *iter << endl;
701 queue_push( &(_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
702 queue_push( &(_jobQueue),
id );
707 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
709 queue_push( &(_jobQueue), SOLVER_BLACKLIST|SOLVER_SOLVABLE_PROVIDES );
716 const auto & trackedLocaleIds( myPool().trackedLocaleIds() );
719 for (
const auto & locale : trackedLocaleIds.added() )
721 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
725 for (
const auto & locale : trackedLocaleIds.removed() )
727 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES | SOLVER_CLEANDEPS );
733 for (
const sat::Solvable & solv : myPool().multiversionList() )
735 queue_push( &(_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE );
736 queue_push( &(_jobQueue), solv.id() );
739 ::pool_add_userinstalled_jobs(_satPool,
sat::Pool::instance().autoInstalled(), &(_jobQueue), GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED);
743 SATResolver::solverEnd()
748 solver_free(_satSolver);
750 queue_free( &(_jobQueue) );
756 SATResolver::resolvePool(
const CapabilitySet & requires_caps,
758 const PoolItemList & weakItems,
759 const std::set<Repository> & upgradeRepos)
761 MIL <<
"SATResolver::resolvePool()" << endl;
764 solverInit(weakItems);
766 for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
769 ERR <<
"Install: " << *iter <<
" not found" << endl;
771 MIL <<
"Install " << *iter << endl;
772 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
773 queue_push( &(_jobQueue),
id );
777 for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
780 ERR <<
"Delete: " << *iter <<
" not found" << endl;
782 MIL <<
"Delete " << *iter << endl;
783 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
784 queue_push( &(_jobQueue),
id);
788 for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
790 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
791 queue_push( &(_jobQueue), iter->get()->repoid );
792 MIL <<
"Upgrade repo " << *iter << endl;
795 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
796 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
797 queue_push( &(_jobQueue), iter->id() );
798 MIL <<
"Requires " << *iter << endl;
801 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
802 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
803 queue_push( &(_jobQueue), iter->id() );
804 MIL <<
"Conflicts " << *iter << endl;
808 setSystemRequirements();
814 bool ret = solving(requires_caps, conflict_caps);
816 (ret?
MIL:
WAR) <<
"SATResolver::resolvePool() done. Ret:" << ret << endl;
823 const PoolItemList & weakItems)
825 MIL <<
"SATResolver::resolvQueue()" << endl;
828 solverInit(weakItems);
831 for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
832 (*iter)->addRule(_jobQueue);
836 for (PoolItemList::const_iterator iter = _items_to_install.begin(); iter != _items_to_install.end(); iter++) {
839 ERR <<
"Install: " << *iter <<
" not found" << endl;
841 MIL <<
"Install " << *iter << endl;
842 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
843 queue_push( &(_jobQueue),
id );
846 for (PoolItemList::const_iterator iter = _items_to_remove.begin(); iter != _items_to_remove.end(); iter++) {
848 MIL <<
"Delete " << *iter << ident << endl;
849 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME |
MAYBE_CLEANDEPS );
850 queue_push( &(_jobQueue), ident);
854 setSystemRequirements();
860 bool ret = solving();
862 MIL <<
"SATResolver::resolveQueue() done. Ret:" << ret << endl;
867 void SATResolver::doUpdate()
869 MIL <<
"SATResolver::doUpdate()" << endl;
872 solverInit(PoolItemList());
875 setSystemRequirements();
881 queue_push( &(_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
882 queue_push( &(_jobQueue), 0 );
885 queue_push( &(_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
886 queue_push( &(_jobQueue), 0 );
889 queue_push( &(_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
890 queue_push( &(_jobQueue), 0 );
892 if (_distupgrade_removeunsupported) {
893 queue_push( &(_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
894 queue_push( &(_jobQueue), 0 );
896 solverSetFocus( *_satSolver, _focus );
897 solver_set_flag(_satSolver, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED, !_ignorealreadyrecommended);
898 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_DOWNGRADE, _allowdowngrade);
899 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_NAMECHANGE, _allownamechange);
900 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_ARCHCHANGE, _allowarchchange);
901 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_VENDORCHANGE, _allowvendorchange);
902 solver_set_flag(_satSolver, SOLVER_FLAG_ALLOW_UNINSTALL, _allowuninstall);
903 solver_set_flag(_satSolver, SOLVER_FLAG_NO_UPDATEPROVIDE, _noupdateprovide);
904 solver_set_flag(_satSolver, SOLVER_FLAG_SPLITPROVIDES, _dosplitprovides);
905 solver_set_flag(_satSolver, SOLVER_FLAG_IGNORE_RECOMMENDED,
false);
906 solver_set_flag(_satSolver, SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, _onlyRequires);
911 MIL <<
"Starting solving for update...." << endl;
913 solver_solve( _satSolver, &(_jobQueue) );
914 MIL <<
"....Solver end" << endl;
921 queue_init(&decisionq);
922 solver_get_decisionqueue(_satSolver, &decisionq);
923 for (
int i = 0; i < decisionq.count; i++)
925 Id p = decisionq.elements[i];
930 if ( ! solv || solv.isSystem() )
935 queue_free(&decisionq);
938 if ( _satSolver->pool->installed ) {
939 for (
int i = _satSolver->pool->installed->start; i < _satSolver->pool->installed->start + _satSolver->pool->installed->nsolvables; i++)
941 if (solver_get_decisionlevel(_satSolver, i) > 0)
944 PoolItem poolItem( _pool.find( sat::Solvable(i) ) );
947 CheckIfUpdate info( (sat::Solvable(i)) );
949 _pool.byIdentEnd( poolItem ),
950 resfilter::ByUninstalled(),
951 functor::functorRef<bool,PoolItem> (info) );
953 if (info.is_updated) {
959 ERR <<
"id " << i <<
" not found in ZYPP pool." << endl;
966 solverCopyBackWeak( *_satSolver, _problem_items );
967 solverCopyBackValidate( *_satSolver, _pool );
969 MIL <<
"SATResolver::doUpdate() done" << endl;
989 : problemSolution (p)
996 problemSolution->addSingleAction (p, action);
1029 std::vector<std::string> SATResolver::SATgetCompleteProblemInfoStrings ( Id problem )
1031 std::vector<std::string> ret;
1032 sat::Queue problems;
1033 solver_findallproblemrules( _satSolver, problem, problems );
1039 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1040 if ( ruleClass != SolverRuleinfo::SOLVER_RULE_UPDATE && ruleClass != SolverRuleinfo::SOLVER_RULE_JOB ) {
1046 SolverRuleinfo ruleClass = solver_ruleclass( _satSolver, problems[i]);
1047 if ( nobad && ( ruleClass == SolverRuleinfo::SOLVER_RULE_UPDATE || ruleClass == SolverRuleinfo::SOLVER_RULE_JOB ) ) {
1053 std::string pInfo = SATproblemRuleInfoString( problems[i], detail, ignore );
1056 if ( std::find( ret.begin(), ret.end(), pInfo ) == ret.end() )
1057 ret.push_back( pInfo );
1062 std::string SATResolver::SATprobleminfoString(Id problem, std::string &detail, Id &ignoreId)
1066 Id probr = solver_findproblemrule(_satSolver, problem);
1067 return SATproblemRuleInfoString( probr, detail, ignoreId );
1070 std::string SATResolver::SATproblemRuleInfoString (Id probr, std::string &detail, Id &ignoreId)
1074 Id dep, source, target;
1075 SolverRuleinfo type = solver_ruleinfo(_satSolver, probr, &source, &target, &dep);
1079 sat::Solvable s = mapSolvable( source );
1080 sat::Solvable s2 = mapSolvable( target );
1087 case SOLVER_RULE_DISTUPGRADE:
1089 ret = str::Format(
_(
"the installed %1% does not belong to a distupgrade repository and must be replaced") ) % s.asString();
1091 ret = str::Format(
_(
"the to be installed %1% does not belong to a distupgrade repository") ) % s.asString();
1093 case SOLVER_RULE_INFARCH:
1095 ret = str::Format(
_(
"the installed %1% has inferior architecture") ) % s.asString();
1097 ret = str::Format(
_(
"the to be installed %1% has inferior architecture") ) % s.asString();
1099 case SOLVER_RULE_UPDATE:
1100 ret = str::Format(
_(
"problem with the installed %1%") ) % s.asString();
1102 case SOLVER_RULE_JOB:
1103 ret =
_(
"conflicting requests");
1105 case SOLVER_RULE_PKG:
1106 ret =
_(
"some dependency problem");
1108 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1109 ret = str::Format(
_(
"nothing provides the requested '%1%'") ) % pool_dep2str(pool, dep);
1110 detail +=
_(
"Have you enabled all the required repositories?");
1112 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1113 ret = str::Format(
_(
"the requested package %1% does not exist") ) % pool_dep2str(pool, dep);
1114 detail +=
_(
"Have you enabled all the required repositories?");
1116 case SOLVER_RULE_JOB_UNSUPPORTED:
1117 ret =
_(
"unsupported request");
1119 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1120 ret = str::Format(
_(
"'%1%' is provided by the system and cannot be erased") ) % pool_dep2str(pool, dep);
1122 case SOLVER_RULE_PKG_NOT_INSTALLABLE:
1123 ret = str::Format(
_(
"%1% is not installable") ) % s.asString();
1125 case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
1128 ret = str::Format(
_(
"nothing provides '%1%' needed by the installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1130 ret = str::Format(
_(
"nothing provides '%1%' needed by the to be installed %2%") ) % pool_dep2str(pool, dep) % s.asString();
1132 case SOLVER_RULE_PKG_SAME_NAME:
1133 ret = str::Format(
_(
"cannot install both %1% and %2%") ) % s.asString() % s2.asString();
1135 case SOLVER_RULE_PKG_CONFLICTS:
1136 if ( s.isSystem() ) {
1137 if ( s2.isSystem() )
1138 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1140 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1143 if ( s2.isSystem() )
1144 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1146 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();
1149 case SOLVER_RULE_PKG_OBSOLETES:
1150 case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
1151 if ( s.isSystem() ) {
1152 if ( s2.isSystem() )
1153 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1155 ret = str::Format(
_(
"the installed %1% obsoletes '%2%' provided by the to be installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1158 if ( s2.isSystem() )
1159 ret = str::Format(
_(
"the to be installed %1% obsoletes '%2%' provided by the installed %3%") ) % s.asString() % pool_dep2str(pool, dep) % s2.asString();
1161 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();
1164 case SOLVER_RULE_PKG_SELF_CONFLICT:
1166 ret = str::Format(
_(
"the installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1168 ret = str::Format(
_(
"the to be installed %1% conflicts with '%2%' provided by itself") ) % s.asString() % pool_dep2str(pool, dep);
1170 case SOLVER_RULE_PKG_REQUIRES: {
1172 Capability cap(dep);
1173 sat::WhatProvides possibleProviders(cap);
1176 typedef std::list<PoolItem> ProviderList;
1177 ProviderList providerlistInstalled, providerlistUninstalled;
1178 for_( iter1, possibleProviders.begin(), possibleProviders.end() ) {
1182 for_( iter2, possibleProviders.begin(), possibleProviders.end() ) {
1185 && ( (provider1.status().isInstalled() && provider2.status().isUninstalled())
1186 || (provider2.status().isInstalled() && provider1.status().isUninstalled()) )) {
1192 if (provider1.status().isInstalled())
1193 providerlistInstalled.push_back(provider1);
1195 providerlistUninstalled.push_back(provider1);
1200 ret = str::Format(
_(
"the installed %1% requires '%2%', but this requirement cannot be provided") ) % s.
asString() % pool_dep2str(pool, dep);
1202 ret = str::Format(
_(
"the to be installed %1% requires '%2%', but this requirement cannot be provided") ) % s.asString() % pool_dep2str(pool, dep);
1203 if (providerlistInstalled.size() > 0) {
1204 detail +=
_(
"deleted providers: ");
1205 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1206 if (iter == providerlistInstalled.begin())
1212 if (providerlistUninstalled.size() > 0) {
1213 if (detail.size() > 0)
1214 detail +=
_(
"\nnot installable providers: ");
1216 detail =
_(
"not installable providers: ");
1217 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1218 if (iter == providerlistUninstalled.begin())
1227 DBG <<
"Unknown rule type(" << type <<
") going to query libsolv for rule information." << endl;
1228 ret =
str::asString( ::solver_problemruleinfo2str( _satSolver, type,
static_cast<Id
>(s.id()),
static_cast<Id
>(s2.id()), dep ) );
1240 void notInstallPatch( sat::Solvable slv_r,
unsigned solution_r )
1241 {
_patch.push_back( slv_r.ident() ); }
1243 void removePtf( sat::Solvable slv_r,
unsigned solution_r )
1244 {
_ptf.push_back( slv_r.ident() ); }
1246 bool applies()
const
1247 {
return not
_ptf.empty(); }
1249 std::string description()
const {
1250 if ( not
_patch.empty() ) {
1253 << (str::Format(
_(
"%1% is not yet fully integrated into %2%.") ) % printlist(
_ptf) % printlist(
_patch)) << endl
1254 <<
_(
"Typically you want to keep the PTF and choose to not install the maintenance patches.");
1259 << (str::Format(
_(
"The installed %1% blocks the desired action.") ) % printlist(
_ptf)) << endl
1260 <<
_(
"Typically you want to keep the PTF and choose to cancel the action.");
1263 using StoreType = IdString;
1264 static std::string printlist(
const std::vector<StoreType> & list_r )
1265 { str::Str ret;
dumpRange( ret.stream(), list_r.begin(), list_r.end(),
"",
"",
", ",
"",
"" );
return ret; }
1274 SATResolver::problems ()
1277 if (_satSolver && solver_problem_count(_satSolver)) {
1281 Id problem, solution, element;
1282 sat::Solvable s, sd;
1284 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1285 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1287 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1290 while ((problem = solver_next_problem(_satSolver, problem)) != 0) {
1291 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1292 MIL <<
"====================================" << endl;
1295 std::string whatString = SATprobleminfoString (problem,detail,ignoreId);
1296 MIL << whatString << endl;
1297 MIL <<
"------------------------------------" << endl;
1298 ResolverProblem_Ptr resolverProblem =
new ResolverProblem (whatString, detail, SATgetCompleteProblemInfoStrings( problem ));
1299 PtfPatchHint ptfPatchHint;
1301 while ((solution = solver_next_solution(_satSolver, problem, solution)) != 0) {
1303 ProblemSolutionCombi *problemSolution =
new ProblemSolutionCombi;
1304 while ((element = solver_next_solutionelement(_satSolver, problem, solution, element, &p, &rp)) != 0) {
1305 if (p == SOLVER_SOLUTION_JOB) {
1307 what = _jobQueue.elements[rp];
1308 switch (_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1310 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1311 s = mapSolvable (what);
1312 PoolItem poolItem = _pool.find (s);
1314 if (pool->installed && s.get()->repo == pool->installed) {
1315 problemSolution->addSingleAction (poolItem, REMOVE);
1316 std::string description = str::Format(
_(
"remove lock to allow removal of %1%") ) % s.asString();
1317 MIL << description << endl;
1318 problemSolution->addDescription (description);
1320 problemSolution->addSingleAction (poolItem, KEEP);
1321 std::string description = str::Format(
_(
"do not install %1%") ) % s.asString();
1322 MIL << description << endl;
1323 problemSolution->addDescription (description);
1324 if ( s.isKind<Patch>() )
1325 ptfPatchHint.notInstallPatch( s, resolverProblem->solutions().size() );
1328 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.asString() << endl;
1332 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1333 s = mapSolvable (what);
1334 PoolItem poolItem = _pool.find (s);
1336 if (pool->installed && s.get()->repo == pool->installed) {
1337 problemSolution->addSingleAction (poolItem, KEEP);
1338 std::string description = str::Format(
_(
"keep %1%") ) % s.asString();
1339 MIL << description << endl;
1340 problemSolution->addDescription (description);
1342 problemSolution->addSingleAction (poolItem, UNLOCK);
1343 std::string description = str::Format(
_(
"remove lock to allow installation of %1%") ) %
itemToString( poolItem );
1344 MIL << description << endl;
1345 problemSolution->addDescription (description);
1348 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.asString() << endl;
1352 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1354 IdString ident( what );
1355 SolverQueueItemInstall_Ptr install =
1356 new SolverQueueItemInstall(_pool, ident.asString(),
false );
1357 problemSolution->addSingleAction (install, REMOVE_SOLVE_QUEUE_ITEM);
1359 std::string description = str::Format(
_(
"do not install %1%") ) % ident;
1360 MIL << description << endl;
1361 problemSolution->addDescription (description);
1364 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1368 IdString ident( what );
1369 FindPackage info (problemSolution, KEEP);
1371 _pool.byIdentEnd( ident ),
1373 resfilter::ByTransact ()),
1374 functor::functorRef<bool,PoolItem> (info) );
1376 SolverQueueItemDelete_Ptr del =
1377 new SolverQueueItemDelete(_pool, ident.asString(),
false );
1378 problemSolution->addSingleAction (del, REMOVE_SOLVE_QUEUE_ITEM);
1380 std::string description = str::Format(
_(
"keep %1%") ) % ident;
1381 MIL << description << endl;
1382 problemSolution->addDescription (description);
1385 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1387 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_REQUIRE);
1388 std::string description =
"";
1391 if (system_requires.find(Capability(what)) != system_requires.end()) {
1393 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1394 resolverProblem->setDescription(
_(
"This request will break your system!"));
1395 description =
_(
"ignore the warning of a broken system");
1396 description += std::string(
" (requires:")+pool_dep2str(pool, what)+
")";
1397 MIL << description << endl;
1398 problemSolution->addFrontDescription (description);
1400 description = str::Format(
_(
"do not ask to install a solvable providing %1%") ) % pool_dep2str(pool, what);
1401 MIL << description << endl;
1402 problemSolution->addDescription (description);
1406 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1408 problemSolution->addSingleAction (Capability(what), REMOVE_EXTRA_CONFLICT);
1409 std::string description =
"";
1412 if (system_conflicts.find(Capability(what)) != system_conflicts.end()) {
1414 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1415 resolverProblem->setDescription(
_(
"This request will break your system!"));
1416 description =
_(
"ignore the warning of a broken system");
1417 description += std::string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1418 MIL << description << endl;
1419 problemSolution->addFrontDescription (description);
1422 description = str::Format(
_(
"do not ask to delete all solvables providing %1%") ) % pool_dep2str(pool, what);
1423 MIL << description << endl;
1424 problemSolution->addDescription (description);
1428 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1430 s = mapSolvable (what);
1431 PoolItem poolItem = _pool.find (s);
1433 if (pool->installed && s.get()->repo == pool->installed) {
1434 problemSolution->addSingleAction (poolItem, KEEP);
1435 std::string description = str::Format(
_(
"do not install most recent version of %1%") ) % s.asString();
1436 MIL << description << endl;
1437 problemSolution->addDescription (description);
1439 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1442 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.asString() << endl;
1447 MIL <<
"- do something different" << endl;
1448 ERR <<
"No valid solution available" << endl;
1451 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1452 s = mapSolvable (rp);
1453 PoolItem poolItem = _pool.find (s);
1454 if (pool->installed && s.get()->repo == pool->installed) {
1455 problemSolution->addSingleAction (poolItem, LOCK);
1456 std::string description = str::Format(
_(
"keep %1% despite the inferior architecture") ) % s.asString();
1457 MIL << description << endl;
1458 problemSolution->addDescription (description);
1460 problemSolution->addSingleAction (poolItem, INSTALL);
1461 std::string description = str::Format(
_(
"install %1% despite the inferior architecture") ) % s.asString();
1462 MIL << description << endl;
1463 problemSolution->addDescription (description);
1465 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1466 s = mapSolvable (rp);
1467 PoolItem poolItem = _pool.find (s);
1468 if (pool->installed && s.get()->repo == pool->installed) {
1469 problemSolution->addSingleAction (poolItem, LOCK);
1470 std::string description = str::Format(
_(
"keep obsolete %1%") ) % s.asString();
1471 MIL << description << endl;
1472 problemSolution->addDescription (description);
1474 problemSolution->addSingleAction (poolItem, INSTALL);
1475 std::string description = str::Format(
_(
"install %1% from excluded repository") ) % s.asString();
1476 MIL << description << endl;
1477 problemSolution->addDescription (description);
1479 }
else if ( p == SOLVER_SOLUTION_BLACK ) {
1482 s = mapSolvable (rp);
1483 PoolItem poolItem = _pool.find (s);
1485 problemSolution->addSingleAction (poolItem, INSTALL);
1486 std::string description;
1487 if ( s.isRetracted() ) {
1489 description = str::Format(
_(
"install %1% although it has been retracted")) % s.asString();
1490 }
else if ( s.isPtf() ) {
1492 description = str::Format(
_(
"allow installing the PTF %1%")) % s.asString();
1495 description = str::Format(
_(
"install %1% although it is blacklisted")) % s.asString();
1497 MIL << description << endl;
1498 problemSolution->addDescription( description );
1499 }
else if ( p > 0 ) {
1501 s = mapSolvable (p);
1502 PoolItem itemFrom = _pool.find (s);
1507 sd = mapSolvable (rp);
1508 PoolItem itemTo = _pool.find (sd);
1509 if (itemFrom && itemTo) {
1510 problemSolution->addSingleAction (itemTo, INSTALL);
1511 int illegal = policy_is_illegal(_satSolver, s.get(), sd.get(), 0);
1513 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1515 std::string description = str::Format(
_(
"downgrade of %1% to %2%") ) % s.asString() % sd.asString();
1516 MIL << description << endl;
1517 problemSolution->addDescription (description);
1520 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1522 std::string description = str::Format(
_(
"architecture change of %1% to %2%") ) % s.asString() % sd.asString();
1523 MIL << description << endl;
1524 problemSolution->addDescription (description);
1527 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1529 IdString s_vendor( s.vendor() );
1530 IdString sd_vendor( sd.vendor() );
1531 std::string description;
1533 description = str::Format(
_(
"install %1% (with vendor change)\n %2% --> %3%") )
1535 % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " )
1536 % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " );
1538 description = str::Format(
_(
"install %1% from vendor %2%\n replacing %3% from vendor %4%") )
1539 % sd.asString() % ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " )
1540 % s.asString() % ( s_vendor ? s_vendor.c_str() :
" (no vendor) " );
1542 MIL << description << endl;
1543 problemSolution->addDescription (description);
1547 std::string description = str::Format(
_(
"replacement of %1% with %2%") ) % s.asString() % sd.asString();
1548 MIL << description << endl;
1549 problemSolution->addDescription (description);
1552 ERR << s.asString() <<
" or " << sd.asString() <<
" not found" << endl;
1558 std::string description = str::Format(
_(
"deinstallation of %1%") ) % s.asString();
1559 MIL << description << endl;
1560 problemSolution->addDescription (description);
1561 problemSolution->addSingleAction (itemFrom, REMOVE);
1562 if ( s.isPtfMaster() )
1563 ptfPatchHint.removePtf( s, resolverProblem->solutions().size() );
1569 INT <<
"Unknown solution " << p << endl;
1573 resolverProblem->addSolution (problemSolution,
1574 problemSolution->actionCount() > 1 ?
true :
false);
1575 MIL <<
"------------------------------------" << endl;
1580 PoolItem item = _pool.find (sat::Solvable(ignoreId));
1581 ProblemSolutionIgnore *problemSolution =
new ProblemSolutionIgnore(item);
1582 resolverProblem->addSolution (problemSolution,
1584 MIL <<
"ignore some dependencies of " << item << endl;
1585 MIL <<
"------------------------------------" << endl;
1589 if ( ptfPatchHint.applies() ) {
1590 resolverProblem->setDescription( str::Str() << ptfPatchHint.description() << endl <<
"(" << resolverProblem->description() <<
")" );
1593 resolverProblems.push_back (resolverProblem);
1596 return resolverProblems;
1600 { Resolver( _pool ).applySolutions( solutions ); }
1602 void SATResolver::setLocks()
1607 for (PoolItemList::const_iterator iter = _items_to_lock.begin(); iter != _items_to_lock.end(); ++iter) {
1609 if (iter->status().isInstalled()) {
1611 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
1612 queue_push( &(_jobQueue),
id );
1615 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE |
MAYBE_CLEANDEPS );
1616 queue_push( &(_jobQueue),
id );
1619 MIL <<
"Locked " << icnt <<
" installed items and " << acnt <<
" NOT installed items." << endl;
1625 std::set<IdString> unifiedByName;
1626 for (PoolItemList::const_iterator iter = _items_to_keep.begin(); iter != _items_to_keep.end(); ++iter) {
1627 IdString ident( iter->ident() );
1628 if ( unifiedByName.insert( ident ).second )
1632 MIL <<
"Keep NOT installed name " << ident <<
" (" << *iter <<
")" << endl;
1633 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_NAME | SOLVER_WEAK |
MAYBE_CLEANDEPS );
1634 queue_push( &(_jobQueue), ident.id() );
1640 void SATResolver::setSystemRequirements()
1642 CapabilitySet system_requires = SystemCheck::instance().requiredSystemCap();
1643 CapabilitySet system_conflicts = SystemCheck::instance().conflictSystemCap();
1645 for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
1646 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
1647 queue_push( &(_jobQueue), iter->id() );
1648 MIL <<
"SYSTEM Requires " << *iter << endl;
1651 for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
1652 queue_push( &(_jobQueue), SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES |
MAYBE_CLEANDEPS );
1653 queue_push( &(_jobQueue), iter->id() );
1654 MIL <<
"SYSTEM Conflicts " << *iter << endl;
1662 IdString rpm(
"rpm" );
1663 for_( it, pool.byIdentBegin(rpm), pool.byIdentEnd(rpm) )
1665 if ( (*it)->isSystem() )
1668 queue_push( &(_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
1669 queue_push( &(_jobQueue), archrule.id() );
1680 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
1688 ::solver_get_userinstalled( _satSolver, ret, GET_USERINSTALLED_NAMES );
std::vector< StoreType > _ptf
std::vector< StoreType > _patch
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.
static Pool instance()
Singleton ctor.
void prepare() const
Update housekeeping data if necessary (e.g.
detail::CPool * get() const
Expert backdoor.
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.
std::unary_function< PoolItem, bool > PoolItemFilterFunctor
std::unary_function< ResObject::constPtr, bool > ResObjectFilterFunctor
::s_Solver CSolver
Wrapped libsolv C data type exposed as backdoor.
int IdType
Generic Id type.
::s_Pool CPool
Wrapped libsolv C data type exposed as backdoor.
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
bool compareByNVR(const SolvableType< Derived > &lhs, const Solvable &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Queue SolvableQueue
Queue with Solvable ids.
Queue StringQueue
Queue with String ids.
bool sameNVRA(const SolvableType< Derived > &lhs, const Solvable &rhs)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static void SATSolutionToPool(PoolItem item, const ResStatus &status, const ResStatus::TransactByValue causer)
int vendorCheck(sat::detail::CPool *pool, Solvable *solvable1, Solvable *solvable2)
sat::Solvable mapBuddy(sat::Solvable item_r)
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)
IMPL_PTR_TYPE(SATResolver)
std::list< SolverQueueItem_Ptr > SolverQueueItemList
std::string itemToString(const PoolItem &item)
const std::string & asString(const std::string &t)
Global asString() that works with std::string too.
bool isPseudoInstalled(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.
std::unordered_set< Capability > CapabilitySet
@ language
language support
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< ResolverProblem_Ptr > ResolverProblemList
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).
std::ostream & dumpOn(std::ostream &str, const Capability &obj)
std::list< ProblemSolution_Ptr > ProblemSolutionList
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.
std::string asString() const
bool multiversionInstall() const
bool operator()(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.