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>
71 #define MAYBE_CLEANDEPS (cleandepsOnRemove()?SOLVER_CLEANDEPS:0)
77 int vendorCheck( Pool *pool, Solvable *solvable1, Solvable *solvable2 )
80 IdString(solvable2->vendor) ) ? 0 : 1;
90 std::string ret( slv.asString() );
91 if ( ! slv.isSystem() )
104 INT <<
"id " << id_r <<
" not found in ZYPP pool." << endl;
113 os <<
"<resolver>" << endl;
117 os <<
" allowdowngrade = " << solver_get_flag(_solv, SOLVER_FLAG_ALLOW_DOWNGRADE) << endl;
118 os <<
" allowarchchange = " << solver_get_flag(_solv, SOLVER_FLAG_ALLOW_ARCHCHANGE) << endl;
119 os <<
" allowvendorchange = " << solver_get_flag(_solv, SOLVER_FLAG_ALLOW_VENDORCHANGE) << endl;
120 os <<
" allowuninstall = " << solver_get_flag(_solv, SOLVER_FLAG_ALLOW_UNINSTALL) << endl;
121 os <<
" noupdateprovide = " << solver_get_flag(_solv, SOLVER_FLAG_NO_UPDATEPROVIDE) << endl;
122 os <<
" dosplitprovides = " << solver_get_flag(_solv, SOLVER_FLAG_SPLITPROVIDES) << endl;
123 os <<
" onlyRequires = " << solver_get_flag(_solv, SOLVER_FLAG_IGNORE_RECOMMENDED) << endl;
124 os <<
" ignorealreadyrecommended = " << !solver_get_flag(_solv, SOLVER_FLAG_ADD_ALREADY_RECOMMENDED) << endl;
125 os <<
" distupgrade = " << _distupgrade << endl;
126 os <<
" distupgrade_removeunsupported = " << _distupgrade_removeunsupported << endl;
127 os <<
" solveSrcPackages = " << _solveSrcPackages << endl;
128 os <<
" cleandepsOnRemove = " << _cleandepsOnRemove << endl;
132 return os <<
"<resolver/>" << endl;
142 , _allowdowngrade(false)
143 , _allowarchchange(false)
144 , _allowvendorchange(
ZConfig::instance().solver_allowVendorChange())
145 , _allowuninstall(false)
146 , _updatesystem(false)
147 , _noupdateprovide(false)
148 , _dosplitprovides(false)
149 , _onlyRequires(
ZConfig::instance().solver_onlyRequires())
150 , _ignorealreadyrecommended(false)
151 , _distupgrade(false)
152 , _distupgrade_removeunsupported(false)
153 , _solveSrcPackages(false)
154 , _cleandepsOnRemove(
ZConfig::instance().solver_cleandepsOnRemove())
229 for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
247 for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
285 _XDEBUG(
"SATSolutionToPool install returns " << item <<
", " << r);
289 _XDEBUG(
"SATSolutionToPool upgrade returns " << item <<
", " << r);
293 _XDEBUG(
"SATSolutionToPool remove returns " << item <<
", " << r);
427 queue_push( &(
_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
431 queue_push( &(
_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
435 queue_push( &(
_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
439 queue_push( &(
_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
454 MIL <<
"Starting solving...." << endl;
457 MIL <<
"....Solver end" << endl;
466 queue_init(&decisionq);
467 solver_get_decisionqueue(
_solv, &decisionq);
468 for (
int i = 0; i < decisionq.count; ++i )
478 queue_free(&decisionq);
484 bool mustCheckObsoletes =
false;
487 if (solver_get_decisionlevel(
_solv, it->id()) > 0)
496 functor::functorRef<bool,PoolItem> (info) );
502 if ( ! mustCheckObsoletes )
503 mustCheckObsoletes =
true;
507 if ( mustCheckObsoletes )
510 for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
514 if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
520 Queue recommendations;
524 queue_init(&recommendations);
525 queue_init(&suggestions);
526 queue_init(&orphaned);
527 queue_init(&unneeded);
528 solver_get_recommendations(
_solv, &recommendations, &suggestions, 0);
529 solver_get_orphaned(
_solv, &orphaned);
530 solver_get_unneeded(
_solv, &unneeded, 1);
532 for (
int i = 0; i < recommendations.count; ++i )
539 for (
int i = 0; i < suggestions.count; ++i )
547 for (
int i = 0; i < orphaned.count; ++i )
555 for (
int i = 0; i < unneeded.count; ++i )
561 queue_free(&recommendations);
562 queue_free(&suggestions);
563 queue_free(&orphaned);
564 queue_free(&unneeded);
567 Queue flags, solvableQueue;
570 queue_init(&solvableQueue);
575 functor::functorRef<bool,PoolItem> (collectPseudoInstalled) );
576 solver_trivial_installable(
_solv, &solvableQueue, &flags );
577 for (
int i = 0; i < solvableQueue.count; i++) {
581 if (flags.elements[i] == -1) {
583 _XDEBUG(
"SATSolutionToPool(" << item <<
" ) nonRelevant !");
584 }
else if (flags.elements[i] == 1) {
586 _XDEBUG(
"SATSolutionToPool(" << item <<
" ) satisfied !");
587 }
else if (flags.elements[i] == 0) {
589 _XDEBUG(
"SATSolutionToPool(" << item <<
" ) broken !");
592 queue_free(&(solvableQueue));
599 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
601 for_( iter2, rpmProviders.
begin(), rpmProviders.
end() ) {
604 MIL <<
"User requirement " << *iter <<
" sets " << poolItem << endl;
609 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
611 for_( iter2, rpmProviders.
begin(), rpmProviders.
end() ) {
614 MIL <<
"User conflict " << *iter <<
" sets " << poolItem << endl;
620 if (solver_problem_count(
_solv) > 0 )
622 ERR <<
"Solverrun finished with an ERROR" << endl;
635 MIL <<
"SATResolver::solverInit()" << endl;
647 functor::functorRef<bool,PoolItem>(info) );
649 for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
650 Id
id = (*iter)->satSolvable().id();
652 ERR <<
"Weaken: " << *iter <<
" not found" << endl;
654 MIL <<
"Weaken dependencies of " << *iter << endl;
655 queue_push( &(
_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
662 queue_push( &(
_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE_NAME );
671 queue_push( &(
_jobQueue), SOLVER_USERINSTALLED | SOLVER_SOLVABLE_NAME );
680 MIL <<
"Checking droplists ..." << endl;
686 if ( (*it)->onSystem() )
693 dumpRangeLine(
MIL <<
"Droplist for " << (*it)->candidateObj() <<
": " << droplist.size() <<
" ", droplist.begin(), droplist.end() ) << endl;
694 for_( cap, droplist.begin(), droplist.end() )
696 queue_push( &
_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
704 MIL <<
"Droplist processing is disabled." << endl;
726 const std::set<Repository> & upgradeRepos)
728 MIL <<
"SATResolver::resolvePool()" << endl;
734 Id
id = (*iter)->satSolvable().id();
736 ERR <<
"Install: " << *iter <<
" not found" << endl;
738 MIL <<
"Install " << *iter << endl;
739 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
745 Id
id = (*iter)->satSolvable().id();
747 ERR <<
"Delete: " << *iter <<
" not found" << endl;
749 MIL <<
"Delete " << *iter << endl;
755 for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
757 queue_push( &(
_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
758 queue_push( &(
_jobQueue), iter->get()->repoid );
759 MIL <<
"Upgrade repo " << *iter << endl;
762 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
763 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
765 MIL <<
"Requires " << *iter << endl;
768 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
771 MIL <<
"Conflicts " << *iter << endl;
781 bool ret =
solving(requires_caps, conflict_caps);
783 (ret?
MIL:
WAR) <<
"SATResolver::resolvePool() done. Ret:" << ret << endl;
792 MIL <<
"SATResolver::resolvQueue()" << endl;
798 for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
804 Id
id = (*iter)->satSolvable().id();
806 ERR <<
"Install: " << *iter <<
" not found" << endl;
808 MIL <<
"Install " << *iter << endl;
809 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
815 MIL <<
"Delete " << *iter << ident << endl;
829 MIL <<
"SATResolver::resolveQueue() done. Ret:" << ret << endl;
836 MIL <<
"SATResolver::doUpdate()" << endl;
850 queue_push( &(
_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
854 queue_push( &(
_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
858 queue_push( &(
_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
862 queue_push( &(
_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
877 MIL <<
"Starting solving for update...." << endl;
880 MIL <<
"....Solver end" << endl;
887 queue_init(&decisionq);
888 solver_get_decisionqueue(
_solv, &decisionq);
889 for (
int i = 0; i < decisionq.count; i++)
892 p = decisionq.elements[i];
902 ERR <<
"id " << p <<
" not found in ZYPP pool." << endl;
905 queue_free(&decisionq);
908 for (
int i =
_solv->pool->installed->start; i < _solv->
pool->installed->start +
_solv->pool->installed->nsolvables; i++)
910 if (solver_get_decisionlevel(
_solv, i) > 0)
920 functor::functorRef<bool,PoolItem> (info) );
928 ERR <<
"id " << i <<
" not found in ZYPP pool." << endl;
931 MIL <<
"SATResolver::doUpdate() done" << endl;
996 Id dep, source, target;
1000 probr = solver_findproblemrule(
_solv, problem);
1001 switch (solver_ruleinfo(
_solv, probr, &source, &target, &dep))
1003 case SOLVER_RULE_DISTUPGRADE:
1005 ret =
str::form (
_(
"%s does not belong to a distupgrade repository"), s.
asString().c_str());
1007 case SOLVER_RULE_INFARCH:
1011 case SOLVER_RULE_UPDATE:
1015 case SOLVER_RULE_JOB:
1016 ret =
_(
"conflicting requests");
1018 case SOLVER_RULE_RPM:
1019 ret =
_(
"some dependency problem");
1021 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1022 ret =
str::form (
_(
"nothing provides requested %s"), pool_dep2str(pool, dep));
1023 detail +=
_(
"Have you enabled all requested repositories?");
1025 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1026 ret =
str::form (
_(
"package %s does not exist"), pool_dep2str(pool, dep));
1027 detail +=
_(
"Have you enabled all requested repositories?");
1029 case SOLVER_RULE_JOB_UNSUPPORTED:
1030 ret =
_(
"unsupported request");
1032 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1033 ret =
str::form (
_(
"%s is provided by the system and cannot be erased"), pool_dep2str(pool, dep));
1035 case SOLVER_RULE_RPM_NOT_INSTALLABLE:
1039 case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
1042 ret =
str::form (
_(
"nothing provides %s needed by %s"), pool_dep2str(pool, dep), s.
asString().c_str());
1044 case SOLVER_RULE_RPM_SAME_NAME:
1049 case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
1052 ret =
str::form (
_(
"%s conflicts with %s provided by %s"), s.
asString().c_str(), pool_dep2str(pool, dep), s2.
asString().c_str());
1054 case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
1059 case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
1062 ret =
str::form (
_(
"installed %s obsoletes %s provided by %s"), s.
asString().c_str(), pool_dep2str(pool, dep), s2.
asString().c_str());
1064 case SOLVER_RULE_RPM_SELF_CONFLICT:
1066 ret =
str::form (
_(
"solvable %s conflicts with %s provided by itself"), s.
asString().c_str(), pool_dep2str(pool, dep));
1068 case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
1075 typedef list<PoolItem> ProviderList;
1076 ProviderList providerlistInstalled, providerlistUninstalled;
1077 for_( iter1, possibleProviders.
begin(), possibleProviders.
end() ) {
1081 for_( iter2, possibleProviders.
begin(), possibleProviders.
end() ) {
1092 providerlistInstalled.push_back(provider1);
1094 providerlistUninstalled.push_back(provider1);
1098 ret =
str::form (
_(
"%s requires %s, but this requirement cannot be provided"), s.
asString().c_str(), pool_dep2str(pool, dep));
1099 if (providerlistInstalled.size() > 0) {
1100 detail +=
_(
"deleted providers: ");
1101 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1102 if (iter == providerlistInstalled.begin())
1108 if (providerlistUninstalled.size() > 0) {
1109 if (detail.size() > 0)
1110 detail +=
_(
"\nuninstallable providers: ");
1112 detail =
_(
"uninstallable providers: ");
1113 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1114 if (iter == providerlistUninstalled.begin())
1134 Id problem, solution, element;
1140 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1143 while ((problem = solver_next_problem(
_solv, problem)) != 0) {
1144 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1145 MIL <<
"====================================" << endl;
1149 MIL << whatString << endl;
1150 MIL <<
"------------------------------------" << endl;
1151 ResolverProblem_Ptr resolverProblem =
new ResolverProblem (whatString, detail);
1154 while ((solution = solver_next_solution(
_solv, problem, solution)) != 0) {
1157 while ((element = solver_next_solutionelement(
_solv, problem, solution, element, &p, &rp)) != 0) {
1158 if (p == SOLVER_SOLUTION_JOB) {
1161 switch (
_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1163 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1167 if (pool->installed && s.
get()->repo == pool->installed) {
1169 string description =
str::form (
_(
"do not keep %s installed"), s.
asString().c_str() );
1170 MIL << description << endl;
1175 MIL << description << endl;
1179 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.
asString() << endl;
1183 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1187 if (pool->installed && s.
get()->repo == pool->installed) {
1190 MIL << description << endl;
1194 string description =
str::form (
_(
"do not forbid installation of %s"),
itemToString( poolItem ).c_str());
1195 MIL << description << endl;
1199 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.
asString() << endl;
1203 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1206 SolverQueueItemInstall_Ptr install =
1210 string description =
str::form (
_(
"do not install %s"), ident.
c_str() );
1211 MIL << description << endl;
1215 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1225 functor::functorRef<bool,PoolItem> (info) );
1227 SolverQueueItemDelete_Ptr del =
1232 MIL << description << endl;
1236 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1239 string description =
"";
1242 if (system_requires.find(
Capability(what)) != system_requires.end()) {
1244 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1245 resolverProblem->setDescription(
_(
"This request will break your system!"));
1246 description =
_(
"ignore the warning of a broken system");
1247 description += string(
" (requires:")+pool_dep2str(pool, what)+
")";
1248 MIL << description << endl;
1251 description =
str::form (
_(
"do not ask to install a solvable providing %s"), pool_dep2str(pool, what));
1252 MIL << description << endl;
1257 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1260 string description =
"";
1263 if (system_conflicts.find(
Capability(what)) != system_conflicts.end()) {
1265 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1266 resolverProblem->setDescription(
_(
"This request will break your system!"));
1267 description =
_(
"ignore the warning of a broken system");
1268 description += string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1269 MIL << description << endl;
1273 description =
str::form (
_(
"do not ask to delete all solvables providing %s"), pool_dep2str(pool, what));
1274 MIL << description << endl;
1279 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1284 if (pool->installed && s.
get()->repo == pool->installed) {
1286 string description =
str::form (
_(
"do not install most recent version of %s"), s.
asString().c_str());
1287 MIL << description << endl;
1290 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1293 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.
asString() << endl;
1298 MIL <<
"- do something different" << endl;
1299 ERR <<
"No valid solution available" << endl;
1302 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1305 if (pool->installed && s.
get()->repo == pool->installed) {
1307 string description =
str::form (
_(
"keep %s despite the inferior architecture"), s.
asString().c_str());
1308 MIL << description << endl;
1312 string description =
str::form (
_(
"install %s despite the inferior architecture"), s.
asString().c_str());
1313 MIL << description << endl;
1316 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1319 if (pool->installed && s.
get()->repo == pool->installed) {
1322 MIL << description << endl;
1326 string description =
str::form (
_(
"install %s from excluded repository"), s.
asString().c_str());
1327 MIL << description << endl;
1340 if (itemFrom && itemTo) {
1342 int illegal = policy_is_illegal(
_solv, s.
get(), sd.
get(), 0);
1344 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1347 MIL << description << endl;
1351 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1354 MIL << description << endl;
1358 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1362 string description =
str::form (
_(
"install %s (with vendor change)\n %s --> %s") ,
1364 ( s_vendor ? s_vendor.c_str() :
" (no vendor) " ),
1365 ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " ) );
1366 MIL << description << endl;
1372 MIL << description << endl;
1383 MIL << description << endl;
1390 resolverProblem->addSolution (problemSolution,
1391 problemSolution->
actionCount() > 1 ?
true :
false);
1392 MIL <<
"------------------------------------" << endl;
1399 resolverProblem->addSolution (problemSolution,
1401 MIL <<
"ignore some dependencies of " << item << endl;
1402 MIL <<
"------------------------------------" << endl;
1406 resolverProblems.push_back (resolverProblem);
1409 return resolverProblems;
1415 for (ProblemSolutionList::const_iterator iter = solutions.begin();
1416 iter != solutions.end(); ++iter) {
1417 ProblemSolution_Ptr solution = *iter;
1419 if (!solution->apply (dummyResolver))
1428 if (iter->status().isInstalled()) {
1429 MIL <<
"Lock installed item " << *iter << endl;
1430 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
1433 MIL <<
"Lock NOT installed item " << *iter << endl;
1443 std::set<IdString> unifiedByName;
1445 IdString ident( (*iter)->satSolvable().ident() );
1446 if ( unifiedByName.insert( ident ).second )
1450 MIL <<
"Keep NOT installed name " << ident <<
" (" << *iter <<
")" << endl;
1463 for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
1464 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
1466 MIL <<
"SYSTEM Requires " << *iter << endl;
1469 for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
1472 MIL <<
"SYSTEM Conflicts " << *iter << endl;
1483 if ( (*it)->isSystem() )
1486 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
1487 queue_push( &(
_jobQueue), archrule.id() );
Repository repository() const
The Repository this Solvable belongs to.
void addPoolItemToKeep(PoolItem item)
bool setTransactByValue(TransactByValue causer)
std::list< ProblemSolution_Ptr > ProblemSolutionList
int IdType
Generic Id type.
A Solvable object within the sat Pool.
const_iterator begin() const
Container of Solvable providing a Capability (read only).
void addFrontDescription(const std::string &description)
Set description text (prepend)
std::string alias() const
Short unique string to identify a repo.
bool isToBeUninstalledDueToUpgrade() const
static ZConfig & instance()
Singleton ctor.
bool operator()(PoolItem item)
bool cleandepsOnRemove() const
void addPoolItemsToInstallFromList(PoolItemList &rl)
Class representing one possible solution to one problem found during resolving This problem solution ...
bool isToBeUninstalled() const
SATCollectTransact(SATResolver &r)
CheckIfUpdate(sat::Solvable installed_r)
ProblemSolutionCombi * problemSolution
bool operator()(PoolItem p)
const_iterator byKindBegin(const ResKind &kind_r) const
static const ResStatus toBeInstalled
void addPoolItemToLock(PoolItem item)
std::string asString() const
String representation "ident-edition.arch" or "noSolvable".
bool isSystem() const
Return whether this Solvable belongs to the system repo.
bool isUninstalled() const
unsigned SolvableIdType
Id type to connect Solvable and sat-solvable.
int invokeOnEach(_Iterator begin_r, _Iterator end_r, _Filter filter_r, _Function fnc_r)
Iterate through [begin_r,end_r) and invoke fnc_r on each item that passes filter_r.
SolvableIterator solvablesEnd() const
Iterator behind the last Solvable.
::_Solvable * get() const
Expert backdoor.
void setOrphaned(bool toVal_r=true)
Access to the sat-pools string space.
void resetItemTransaction(PoolItem item)
std::list< PoolItem > PoolItemList
#define for_(IT, BEG, END)
Convenient for-loops using iterator.
bool resetTransact(TransactByValue causer_r)
Not the same as setTransact( false ).
TraitsType::constPtrType constPtr
const_iterator end() const
std::list< SolverQueueItem_Ptr > SolverQueueItemList
byIdent_iterator byIdentEnd(const ByIdent &ident_r) const
ResPool::instance().proxy();.
static void SATSolutionToPool(PoolItem item, const ResStatus &status, const ResStatus::TransactByValue causer)
std::tr1::unordered_set< Capability > CapabilitySet
bool solving(const CapabilitySet &requires_caps=CapabilitySet(), const CapabilitySet &conflict_caps=CapabilitySet())
bool solverUpgradeRemoveDroppedPackages() const
Whether dist upgrade should remove a products dropped packages (true).
PoolItemList _items_to_lock
bool setToBeUninstalledDueToUpgrade(TransactByValue causer)
Select PoolItem by installed.
void addPoolItemToRemove(PoolItem item)
std::string SATprobleminfoString(Id problem, std::string &detail, Id &ignoreId)
std::string asString() const
Conversion to std::string
static const ResStatus toBeUninstalledDueToUpgrade
std::unary_function< ResObject::constPtr, bool > ResObjectFilterFunctor
PoolItemList _items_to_remove
bool equivalent(const Vendor &lVendor, const Vendor &rVendor) const
Return whether two vendor strings shold be treated as the same vendor.
A mid layer class we should remove.
ResObject::constPtr resolvable() const
Returns the ResObject::constPtr.
bool solveSrcPackages() const
int vendorCheck(Pool *pool, Solvable *solvable1, Solvable *solvable2)
void addPoolItemToInstall(PoolItem item)
std::list< ResolverProblem_Ptr > ResolverProblemList
static Pool instance()
Singleton ctor.
SolvableIterator solvablesBegin() const
Iterator to the first Solvable.
const_iterator begin() const
Iterator pointing to the first Solvable.
const_iterator byKindEnd(const ResKind &kind_r) const
PoolItemList _items_to_keep
void addSingleAction(PoolItem item, const TransactionKind action)
Add a single action of an item.
sat::Solvable mapSolvable(const Id &id)
const_iterator end() const
Iterator pointing behind the last Solvable.
bool _ignorealreadyrecommended
std::unary_function< PoolItem, bool > PoolItemFilterFunctor
Interim helper class to collect global options and settings.
Class representing one possible solution to one problem found during resolving This problem solution ...
PoolItemList _problem_items
ResStatus & status() const
Returns the current status.
Chain< _ACondition, _BCondition > chain(_ACondition conda_r, _BCondition condb_r)
Convenience function for creating a Chain from two conditions conda_r and condb_r.
bool operator()(PoolItem item)
#define _(MSG)
Return translated text.
bool isPseudoInstalled(ResKind kind_r)
Those are denoted to be installed, if the solver verifies them as being satisfied.
void addPoolItemsToRemoveFromList(PoolItemList &rl)
void applySolutions(const ProblemSolutionList &solutions)
Container of installed Solvable which would be obsoleted by the Solvable passed to the ctor...
static const SystemCheck & instance()
Singleton.
bool solvablesEmpty() const
Whether Repository contains solvables.
const char * c_str() const
Conversion to const char *
bool setToBeUninstalled(TransactByValue causer)
FindPackage(ProblemSolutionCombi *p, const TransactionKind act)
std::ostream & dumpRangeLine(std::ostream &str, _Iterator begin, _Iterator end)
Print range defined by iterators (single line style).
const CapabilitySet & conflictSystemCap() const
Returns a list of conflicting system capabilities.
CollectPseudoInstalled(Queue *queue)
Select PoolItem by transact.
void addDescription(const std::string description)
Set description text (append)
Select PoolItem by uninstalled.
bool resolveQueue(const SolverQueueItemList &requestQueue, const PoolItemList &weakItems)
std::string form(const char *format,...)
Printf style construction of std::string.
SATResolver(const ResPool &pool, Pool *SATPool)
static Ptr get(const pool::ByIdent &ident_r)
Get the Selctable.
sat::Solvable buddy() const
Return the buddy we share our status object with.
Pathname systemRoot() const
The target root directory.
TransactionKind
A problem solution action that performs a transaction (installs, removes, keep ...) one resolvable (package, patch, pattern, product).
PoolItem getPoolItem(Id id_r)
void setRecommended(bool toVal_r=true)
const CapabilitySet & requiredSystemCap() const
Returns a list of required system capabilities.
bool isToBeInstalled() const
PoolItemList _items_to_install
PoolItemList _result_items_to_install
bool resolvePool(const CapabilitySet &requires_caps, const CapabilitySet &conflict_caps, const PoolItemList &weakItems, const std::set< Repository > &upgradeRepos)
IMPL_PTR_TYPE(ProblemSolutionCombi)
void solverInit(const PoolItemList &weakItems)
int actionCount()
returns the number of actions
sat::Solvable satSolvable() const
Return the corresponding sat::Solvable.
bool setToBeInstalled(TransactByValue causer)
sat::Solvable mapBuddy(const PoolItem &item_r)
bool operator()(PoolItem item)
PoolItemList _result_items_to_remove
PoolItem mapItem(const PoolItem &item)
Reference to a PoolItem connecting ResObject and ResStatus.
bool _distupgrade_removeunsupported
IdType id() const
Expert backdoor.
PoolItem find(const sat::Solvable &slv_r) const
Return the corresponding PoolItem.
virtual std::ostream & dumpOn(std::ostream &str) const
Overload to realize std::ostream & operator<<.
static const VendorAttr & instance()
Singleton.
void setUnneeded(bool toVal_r=true)
bool isKind(const ResKind &kind_r) const
Test whether a Solvable is of a certain ResKind.
std::string itemToString(const PoolItem &item)
byIdent_iterator byIdentBegin(const ByIdent &ident_r) const
static const ResStatus toBeUninstalled
bool setToBeUninstalledDueToObsolete()
void setSystemRequirements()
ResolverProblemList problems()
void prepareForSolving() const
prepare plus some expensive checks done before solving only.
void setSuggested(bool toVal_r=true)
static ResPool instance()
Singleton ctor.