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>
64 inline bool HACKENV(
const char * var_r,
bool default_r )
67 const char * val = ::getenv( var_r );
71 if ( ret != default_r )
72 INT <<
"HACKENV " << var_r <<
" = " << ret << endl;
90 #define MAYBE_CLEANDEPS (cleandepsOnRemove()?SOLVER_CLEANDEPS:0)
96 int vendorCheck( Pool *pool, Solvable *solvable1, Solvable *solvable2 )
99 IdString(solvable2->vendor) ) ? 0 : 1;
106 return std::string();
109 std::string ret( slv.asString() );
110 if ( ! slv.isSystem() )
123 INT <<
"id " << id_r <<
" not found in ZYPP pool." << endl;
132 os <<
"<resolver>" << endl;
134 #define OUTS(X) os << " " << #X << "\t= " << solver_get_flag(_solv, SOLVER_FLAG_##X) << endl
135 OUTS( ALLOW_DOWNGRADE );
136 OUTS( ALLOW_ARCHCHANGE );
137 OUTS( ALLOW_VENDORCHANGE );
138 OUTS( ALLOW_UNINSTALL );
139 OUTS( NO_UPDATEPROVIDE );
140 OUTS( SPLITPROVIDES );
141 OUTS( IGNORE_RECOMMENDED );
142 OUTS( ADD_ALREADY_RECOMMENDED );
143 OUTS( NO_INFARCHCHECK );
144 OUTS( ALLOW_NAMECHANGE );
145 OUTS( KEEP_EXPLICIT_OBSOLETES );
146 OUTS( BEST_OBEY_POLICY );
147 OUTS( NO_AUTOTARGET );
148 OUTS( DUP_ALLOW_DOWNGRADE );
149 OUTS( DUP_ALLOW_ARCHCHANGE );
150 OUTS( DUP_ALLOW_VENDORCHANGE );
151 OUTS( DUP_ALLOW_NAMECHANGE );
152 OUTS( KEEP_ORPHANS );
153 OUTS( BREAK_ORPHANS );
154 OUTS( FOCUS_INSTALLED );
155 OUTS( YUM_OBSOLETES );
157 os <<
" distupgrade = " << _distupgrade << endl;
158 os <<
" distupgrade_removeunsupported = " << _distupgrade_removeunsupported << endl;
159 os <<
" solveSrcPackages = " << _solveSrcPackages << endl;
160 os <<
" cleandepsOnRemove = " << _cleandepsOnRemove << endl;
161 os <<
" fixsystem = " << _fixsystem << endl;
165 return os <<
"<resolver/>" << endl;
175 , _allowdowngrade(false)
176 , _allowarchchange(false)
177 , _allowvendorchange(
ZConfig::instance().solver_allowVendorChange())
178 , _allowuninstall(false)
179 , _updatesystem(false)
180 , _noupdateprovide(false)
181 , _dosplitprovides(true)
182 , _onlyRequires(
ZConfig::instance().solver_onlyRequires())
183 , _ignorealreadyrecommended(true)
184 , _distupgrade(false)
185 , _distupgrade_removeunsupported(false)
186 , _solveSrcPackages(false)
187 , _cleandepsOnRemove(
ZConfig::instance().solver_cleandepsOnRemove())
262 for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
280 for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
318 _XDEBUG(
"SATSolutionToPool install returns " << item <<
", " << r);
322 _XDEBUG(
"SATSolutionToPool upgrade returns " << item <<
", " << r);
326 _XDEBUG(
"SATSolutionToPool remove returns " << item <<
", " << r);
413 : is_updated( false )
414 , multiversion( installed_r.multiversionInstall() )
415 , _installed( installed_r )
424 if ( ! multiversion || sameNVRA( _installed, item ) )
441 :solvableQueue (queue)
460 queue_push( &(
_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
464 queue_push( &(
_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
468 queue_push( &(
_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
472 queue_push( &(
_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
484 #define HACKENV(X,D) solver_set_flag(_solv, X, env::HACKENV( #X, D ) );
485 HACKENV( SOLVER_FLAG_DUP_ALLOW_DOWNGRADE,
true );
486 HACKENV( SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE,
true );
487 HACKENV( SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE,
true );
488 HACKENV( SOLVER_FLAG_DUP_ALLOW_NAMECHANGE,
true );
494 MIL <<
"Starting solving...." << endl;
497 MIL <<
"....Solver end" << endl;
506 queue_init(&decisionq);
507 solver_get_decisionqueue(
_solv, &decisionq);
508 for (
int i = 0; i < decisionq.count; ++i )
518 queue_free(&decisionq);
524 bool mustCheckObsoletes =
false;
527 if (solver_get_decisionlevel(
_solv, it->id()) > 0)
536 functor::functorRef<bool,PoolItem> (info) );
542 if ( ! mustCheckObsoletes )
543 mustCheckObsoletes =
true;
547 if ( mustCheckObsoletes )
550 for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
554 if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
560 Queue recommendations;
564 queue_init(&recommendations);
565 queue_init(&suggestions);
566 queue_init(&orphaned);
567 queue_init(&unneeded);
568 solver_get_recommendations(
_solv, &recommendations, &suggestions, 0);
569 solver_get_orphaned(
_solv, &orphaned);
570 solver_get_unneeded(
_solv, &unneeded, 1);
572 for (
int i = 0; i < recommendations.count; ++i )
579 for (
int i = 0; i < suggestions.count; ++i )
587 for (
int i = 0; i < orphaned.count; ++i )
595 for (
int i = 0; i < unneeded.count; ++i )
601 queue_free(&recommendations);
602 queue_free(&suggestions);
603 queue_free(&orphaned);
604 queue_free(&unneeded);
607 Queue flags, solvableQueue;
610 queue_init(&solvableQueue);
615 functor::functorRef<bool,PoolItem> (collectPseudoInstalled) );
616 solver_trivial_installable(
_solv, &solvableQueue, &flags );
617 for (
int i = 0; i < solvableQueue.count; i++) {
621 if (flags.elements[i] == -1) {
623 _XDEBUG(
"SATSolutionToPool(" << item <<
" ) nonRelevant !");
624 }
else if (flags.elements[i] == 1) {
626 _XDEBUG(
"SATSolutionToPool(" << item <<
" ) satisfied !");
627 }
else if (flags.elements[i] == 0) {
629 _XDEBUG(
"SATSolutionToPool(" << item <<
" ) broken !");
632 queue_free(&(solvableQueue));
639 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
641 for_( iter2, rpmProviders.
begin(), rpmProviders.
end() ) {
644 MIL <<
"User requirement " << *iter <<
" sets " << poolItem << endl;
649 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
651 for_( iter2, rpmProviders.
begin(), rpmProviders.
end() ) {
654 MIL <<
"User conflict " << *iter <<
" sets " << poolItem << endl;
660 if (solver_problem_count(
_solv) > 0 )
662 ERR <<
"Solverrun finished with an ERROR" << endl;
675 MIL <<
"SATResolver::solverInit()" << endl;
687 functor::functorRef<bool,PoolItem>(info) );
689 for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
690 Id
id = (*iter)->satSolvable().id();
692 ERR <<
"Weaken: " << *iter <<
" not found" << endl;
694 MIL <<
"Weaken dependencies of " << *iter << endl;
695 queue_push( &(
_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
702 queue_push( &(
_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE_NAME );
712 MIL <<
"Checking droplists ..." << endl;
718 if ( (*it)->onSystem() )
725 dumpRangeLine(
MIL <<
"Droplist for " << (*it)->candidateObj() <<
": " << droplist.size() <<
" ", droplist.begin(), droplist.end() ) << endl;
726 for_( cap, droplist.begin(), droplist.end() )
728 queue_push( &
_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
736 MIL <<
"Droplist processing is disabled." << endl;
758 const std::set<Repository> & upgradeRepos)
760 MIL <<
"SATResolver::resolvePool()" << endl;
766 Id
id = (*iter)->satSolvable().id();
768 ERR <<
"Install: " << *iter <<
" not found" << endl;
770 MIL <<
"Install " << *iter << endl;
771 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
777 Id
id = (*iter)->satSolvable().id();
779 ERR <<
"Delete: " << *iter <<
" not found" << endl;
781 MIL <<
"Delete " << *iter << endl;
787 for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
789 queue_push( &(
_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
790 queue_push( &(
_jobQueue), iter->get()->repoid );
791 MIL <<
"Upgrade repo " << *iter << endl;
794 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
795 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
797 MIL <<
"Requires " << *iter << endl;
800 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
803 MIL <<
"Conflicts " << *iter << endl;
813 bool ret =
solving(requires_caps, conflict_caps);
815 (ret?
MIL:
WAR) <<
"SATResolver::resolvePool() done. Ret:" << ret << endl;
824 MIL <<
"SATResolver::resolvQueue()" << endl;
830 for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
836 Id
id = (*iter)->satSolvable().id();
838 ERR <<
"Install: " << *iter <<
" not found" << endl;
840 MIL <<
"Install " << *iter << endl;
841 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
847 MIL <<
"Delete " << *iter << ident << endl;
861 MIL <<
"SATResolver::resolveQueue() done. Ret:" << ret << endl;
868 MIL <<
"SATResolver::doUpdate()" << endl;
882 queue_push( &(
_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
886 queue_push( &(
_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
890 queue_push( &(
_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
894 queue_push( &(
_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
909 MIL <<
"Starting solving for update...." << endl;
912 MIL <<
"....Solver end" << endl;
919 queue_init(&decisionq);
920 solver_get_decisionqueue(
_solv, &decisionq);
921 for (
int i = 0; i < decisionq.count; i++)
924 p = decisionq.elements[i];
934 ERR <<
"id " << p <<
" not found in ZYPP pool." << endl;
937 queue_free(&decisionq);
940 for (
int i =
_solv->pool->installed->start; i < _solv->
pool->installed->start +
_solv->pool->installed->nsolvables; i++)
942 if (solver_get_decisionlevel(
_solv, i) > 0)
952 functor::functorRef<bool,PoolItem> (info) );
960 ERR <<
"id " << i <<
" not found in ZYPP pool." << endl;
963 MIL <<
"SATResolver::doUpdate() done" << endl;
983 : problemSolution (p)
1028 Id dep, source, target;
1035 probr = solver_findproblemrule(
_solv, problem);
1036 switch (solver_ruleinfo(
_solv, probr, &source, &target, &dep))
1038 case SOLVER_RULE_DISTUPGRADE:
1040 ret =
str::form (
_(
"%s does not belong to a distupgrade repository"), s.
asString().c_str());
1042 case SOLVER_RULE_INFARCH:
1046 case SOLVER_RULE_UPDATE:
1050 case SOLVER_RULE_JOB:
1051 ret =
_(
"conflicting requests");
1053 case SOLVER_RULE_RPM:
1054 ret =
_(
"some dependency problem");
1056 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1057 ret =
str::form (
_(
"nothing provides requested %s"), pool_dep2str(pool, dep));
1058 detail +=
_(
"Have you enabled all requested repositories?");
1060 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1061 ret =
str::form (
_(
"package %s does not exist"), pool_dep2str(pool, dep));
1062 detail +=
_(
"Have you enabled all requested repositories?");
1064 case SOLVER_RULE_JOB_UNSUPPORTED:
1065 ret =
_(
"unsupported request");
1067 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1068 ret =
str::form (
_(
"%s is provided by the system and cannot be erased"), pool_dep2str(pool, dep));
1070 case SOLVER_RULE_RPM_NOT_INSTALLABLE:
1074 case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
1077 ret =
str::form (
_(
"nothing provides %s needed by %s"), pool_dep2str(pool, dep), s.
asString().c_str());
1079 case SOLVER_RULE_RPM_SAME_NAME:
1084 case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
1087 ret =
str::form (
_(
"%s conflicts with %s provided by %s"), s.
asString().c_str(), pool_dep2str(pool, dep), s2.
asString().c_str());
1089 case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
1094 case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
1097 ret =
str::form (
_(
"installed %s obsoletes %s provided by %s"), s.
asString().c_str(), pool_dep2str(pool, dep), s2.
asString().c_str());
1099 case SOLVER_RULE_RPM_SELF_CONFLICT:
1101 ret =
str::form (
_(
"solvable %s conflicts with %s provided by itself"), s.
asString().c_str(), pool_dep2str(pool, dep));
1103 case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
1110 typedef list<PoolItem> ProviderList;
1111 ProviderList providerlistInstalled, providerlistUninstalled;
1112 for_( iter1, possibleProviders.
begin(), possibleProviders.
end() ) {
1116 for_( iter2, possibleProviders.
begin(), possibleProviders.
end() ) {
1127 providerlistInstalled.push_back(provider1);
1129 providerlistUninstalled.push_back(provider1);
1133 ret =
str::form (
_(
"%s requires %s, but this requirement cannot be provided"), s.
asString().c_str(), pool_dep2str(pool, dep));
1134 if (providerlistInstalled.size() > 0) {
1135 detail +=
_(
"deleted providers: ");
1136 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1137 if (iter == providerlistInstalled.begin())
1143 if (providerlistUninstalled.size() > 0) {
1144 if (detail.size() > 0)
1145 detail +=
_(
"\nuninstallable providers: ");
1147 detail =
_(
"uninstallable providers: ");
1148 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1149 if (iter == providerlistUninstalled.begin())
1169 Id problem, solution, element;
1175 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1178 while ((problem = solver_next_problem(
_solv, problem)) != 0) {
1179 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1180 MIL <<
"====================================" << endl;
1184 MIL << whatString << endl;
1185 MIL <<
"------------------------------------" << endl;
1186 ResolverProblem_Ptr resolverProblem =
new ResolverProblem (whatString, detail);
1189 while ((solution = solver_next_solution(
_solv, problem, solution)) != 0) {
1192 while ((element = solver_next_solutionelement(
_solv, problem, solution, element, &p, &rp)) != 0) {
1193 if (p == SOLVER_SOLUTION_JOB) {
1196 switch (
_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1198 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1202 if (pool->installed && s.
get()->repo == pool->installed) {
1204 string description =
str::form (
_(
"remove lock to allow removal of %s"), s.
asString().c_str() );
1205 MIL << description << endl;
1210 MIL << description << endl;
1214 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.
asString() << endl;
1218 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1222 if (pool->installed && s.
get()->repo == pool->installed) {
1225 MIL << description << endl;
1229 string description =
str::form (
_(
"remove lock to allow installation of %s"),
itemToString( poolItem ).c_str());
1230 MIL << description << endl;
1234 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.
asString() << endl;
1238 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1241 SolverQueueItemInstall_Ptr install =
1245 string description =
str::form (
_(
"do not install %s"), ident.
c_str() );
1246 MIL << description << endl;
1250 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1260 functor::functorRef<bool,PoolItem> (info) );
1262 SolverQueueItemDelete_Ptr del =
1267 MIL << description << endl;
1271 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1274 string description =
"";
1277 if (system_requires.find(
Capability(what)) != system_requires.end()) {
1279 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1280 resolverProblem->setDescription(
_(
"This request will break your system!"));
1281 description =
_(
"ignore the warning of a broken system");
1282 description += string(
" (requires:")+pool_dep2str(pool, what)+
")";
1283 MIL << description << endl;
1286 description =
str::form (
_(
"do not ask to install a solvable providing %s"), pool_dep2str(pool, what));
1287 MIL << description << endl;
1292 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1295 string description =
"";
1298 if (system_conflicts.find(
Capability(what)) != system_conflicts.end()) {
1300 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1301 resolverProblem->setDescription(
_(
"This request will break your system!"));
1302 description =
_(
"ignore the warning of a broken system");
1303 description += string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1304 MIL << description << endl;
1308 description =
str::form (
_(
"do not ask to delete all solvables providing %s"), pool_dep2str(pool, what));
1309 MIL << description << endl;
1314 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1319 if (pool->installed && s.
get()->repo == pool->installed) {
1321 string description =
str::form (
_(
"do not install most recent version of %s"), s.
asString().c_str());
1322 MIL << description << endl;
1325 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1328 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.
asString() << endl;
1333 MIL <<
"- do something different" << endl;
1334 ERR <<
"No valid solution available" << endl;
1337 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1340 if (pool->installed && s.
get()->repo == pool->installed) {
1342 string description =
str::form (
_(
"keep %s despite the inferior architecture"), s.
asString().c_str());
1343 MIL << description << endl;
1347 string description =
str::form (
_(
"install %s despite the inferior architecture"), s.
asString().c_str());
1348 MIL << description << endl;
1351 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1354 if (pool->installed && s.
get()->repo == pool->installed) {
1357 MIL << description << endl;
1361 string description =
str::form (
_(
"install %s from excluded repository"), s.
asString().c_str());
1362 MIL << description << endl;
1375 if (itemFrom && itemTo) {
1377 int illegal = policy_is_illegal(
_solv, s.
get(), sd.
get(), 0);
1379 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1382 MIL << description << endl;
1386 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1389 MIL << description << endl;
1393 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1397 string description =
str::form (
_(
"install %s (with vendor change)\n %s --> %s") ,
1399 ( s_vendor ? s_vendor.c_str() :
" (no vendor) " ),
1400 ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " ) );
1401 MIL << description << endl;
1407 MIL << description << endl;
1418 MIL << description << endl;
1425 resolverProblem->addSolution (problemSolution,
1426 problemSolution->
actionCount() > 1 ?
true :
false);
1427 MIL <<
"------------------------------------" << endl;
1434 resolverProblem->addSolution (problemSolution,
1436 MIL <<
"ignore some dependencies of " << item << endl;
1437 MIL <<
"------------------------------------" << endl;
1441 resolverProblems.push_back (resolverProblem);
1444 return resolverProblems;
1450 for (ProblemSolutionList::const_iterator iter = solutions.begin();
1451 iter != solutions.end(); ++iter) {
1452 ProblemSolution_Ptr solution = *iter;
1454 if (!solution->apply (dummyResolver))
1463 if (iter->status().isInstalled()) {
1464 MIL <<
"Lock installed item " << *iter << endl;
1465 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
1468 MIL <<
"Lock NOT installed item " << *iter << endl;
1478 std::set<IdString> unifiedByName;
1480 IdString ident( (*iter)->satSolvable().ident() );
1481 if ( unifiedByName.insert( ident ).second )
1485 MIL <<
"Keep NOT installed name " << ident <<
" (" << *iter <<
")" << endl;
1498 for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
1499 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
1501 MIL <<
"SYSTEM Requires " << *iter << endl;
1504 for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
1507 MIL <<
"SYSTEM Conflicts " << *iter << endl;
1518 if ( (*it)->isSystem() )
1521 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
1522 queue_push( &(
_jobQueue), archrule.id() );
1533 ::solver_get_userinstalled(
_solv, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
1541 ::solver_get_userinstalled(
_solv, ret, GET_USERINSTALLED_NAMES );
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)
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
std::string form(const char *format,...) __attribute__((format(printf
Printf style construction of std::string.
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())
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.
bool HACKENV(const char *var_r, bool default_r)
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)
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)
Libsolv Id queue wrapper.
sat::StringQueue userInstalled() const
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.
sat::StringQueue autoInstalled() const
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)
bool strToBool(const C_Str &str, bool default_r)
Parse str into a bool depending on the default value.
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)
Easy-to use interface to the ZYPP dependency resolver.
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.