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;
164 return os <<
"<resolver/>" << endl;
174 , _allowdowngrade(false)
175 , _allowarchchange(false)
176 , _allowvendorchange(
ZConfig::instance().solver_allowVendorChange())
177 , _allowuninstall(false)
178 , _updatesystem(false)
179 , _noupdateprovide(false)
180 , _dosplitprovides(false)
181 , _onlyRequires(
ZConfig::instance().solver_onlyRequires())
182 , _ignorealreadyrecommended(true)
183 , _distupgrade(false)
184 , _distupgrade_removeunsupported(false)
185 , _solveSrcPackages(false)
186 , _cleandepsOnRemove(
ZConfig::instance().solver_cleandepsOnRemove())
261 for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
279 for (PoolItemList::const_iterator iter = rl.begin(); iter != rl.end(); iter++) {
317 _XDEBUG(
"SATSolutionToPool install returns " << item <<
", " << r);
321 _XDEBUG(
"SATSolutionToPool upgrade returns " << item <<
", " << r);
325 _XDEBUG(
"SATSolutionToPool remove returns " << item <<
", " << r);
412 : is_updated( false )
413 , multiversion( installed_r.multiversionInstall() )
414 , _installed( installed_r )
423 if ( ! multiversion || sameNVRA( _installed, item ) )
440 :solvableQueue (queue)
459 queue_push( &(
_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
463 queue_push( &(
_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
467 queue_push( &(
_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
471 queue_push( &(
_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
483 #define HACKENV(X,D) solver_set_flag(_solv, X, env::HACKENV( #X, D ) );
484 HACKENV( SOLVER_FLAG_DUP_ALLOW_DOWNGRADE,
true );
485 HACKENV( SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE,
true );
486 HACKENV( SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE,
true );
487 HACKENV( SOLVER_FLAG_DUP_ALLOW_NAMECHANGE,
true );
493 MIL <<
"Starting solving...." << endl;
496 MIL <<
"....Solver end" << endl;
505 queue_init(&decisionq);
506 solver_get_decisionqueue(
_solv, &decisionq);
507 for (
int i = 0; i < decisionq.count; ++i )
517 queue_free(&decisionq);
523 bool mustCheckObsoletes =
false;
526 if (solver_get_decisionlevel(
_solv, it->id()) > 0)
535 functor::functorRef<bool,PoolItem> (info) );
541 if ( ! mustCheckObsoletes )
542 mustCheckObsoletes =
true;
546 if ( mustCheckObsoletes )
549 for_( it, obsoleted.poolItemBegin(), obsoleted.poolItemEnd() )
553 if ( status.transacts() && ! status.isToBeUninstalledDueToUpgrade() )
559 Queue recommendations;
563 queue_init(&recommendations);
564 queue_init(&suggestions);
565 queue_init(&orphaned);
566 queue_init(&unneeded);
567 solver_get_recommendations(
_solv, &recommendations, &suggestions, 0);
568 solver_get_orphaned(
_solv, &orphaned);
569 solver_get_unneeded(
_solv, &unneeded, 1);
571 for (
int i = 0; i < recommendations.count; ++i )
578 for (
int i = 0; i < suggestions.count; ++i )
586 for (
int i = 0; i < orphaned.count; ++i )
594 for (
int i = 0; i < unneeded.count; ++i )
600 queue_free(&recommendations);
601 queue_free(&suggestions);
602 queue_free(&orphaned);
603 queue_free(&unneeded);
606 Queue flags, solvableQueue;
609 queue_init(&solvableQueue);
614 functor::functorRef<bool,PoolItem> (collectPseudoInstalled) );
615 solver_trivial_installable(
_solv, &solvableQueue, &flags );
616 for (
int i = 0; i < solvableQueue.count; i++) {
620 if (flags.elements[i] == -1) {
622 _XDEBUG(
"SATSolutionToPool(" << item <<
" ) nonRelevant !");
623 }
else if (flags.elements[i] == 1) {
625 _XDEBUG(
"SATSolutionToPool(" << item <<
" ) satisfied !");
626 }
else if (flags.elements[i] == 0) {
628 _XDEBUG(
"SATSolutionToPool(" << item <<
" ) broken !");
631 queue_free(&(solvableQueue));
638 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
640 for_( iter2, rpmProviders.
begin(), rpmProviders.
end() ) {
643 MIL <<
"User requirement " << *iter <<
" sets " << poolItem << endl;
648 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
650 for_( iter2, rpmProviders.
begin(), rpmProviders.
end() ) {
653 MIL <<
"User conflict " << *iter <<
" sets " << poolItem << endl;
659 if (solver_problem_count(
_solv) > 0 )
661 ERR <<
"Solverrun finished with an ERROR" << endl;
674 MIL <<
"SATResolver::solverInit()" << endl;
686 functor::functorRef<bool,PoolItem>(info) );
688 for (PoolItemList::const_iterator iter = weakItems.begin(); iter != weakItems.end(); iter++) {
689 Id
id = (*iter)->satSolvable().id();
691 ERR <<
"Weaken: " << *iter <<
" not found" << endl;
693 MIL <<
"Weaken dependencies of " << *iter << endl;
694 queue_push( &(
_jobQueue), SOLVER_WEAKENDEPS | SOLVER_SOLVABLE );
701 queue_push( &(
_jobQueue), SOLVER_NOOBSOLETES | SOLVER_SOLVABLE_NAME );
711 MIL <<
"Checking droplists ..." << endl;
717 if ( (*it)->onSystem() )
724 dumpRangeLine(
MIL <<
"Droplist for " << (*it)->candidateObj() <<
": " << droplist.size() <<
" ", droplist.begin(), droplist.end() ) << endl;
725 for_( cap, droplist.begin(), droplist.end() )
727 queue_push( &
_jobQueue, SOLVER_DROP_ORPHANED | SOLVER_SOLVABLE_NAME );
735 MIL <<
"Droplist processing is disabled." << endl;
757 const std::set<Repository> & upgradeRepos)
759 MIL <<
"SATResolver::resolvePool()" << endl;
765 Id
id = (*iter)->satSolvable().id();
767 ERR <<
"Install: " << *iter <<
" not found" << endl;
769 MIL <<
"Install " << *iter << endl;
770 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
776 Id
id = (*iter)->satSolvable().id();
778 ERR <<
"Delete: " << *iter <<
" not found" << endl;
780 MIL <<
"Delete " << *iter << endl;
786 for_( iter, upgradeRepos.begin(), upgradeRepos.end() )
788 queue_push( &(
_jobQueue), SOLVER_DISTUPGRADE | SOLVER_SOLVABLE_REPO );
789 queue_push( &(
_jobQueue), iter->get()->repoid );
790 MIL <<
"Upgrade repo " << *iter << endl;
793 for (CapabilitySet::const_iterator iter = requires_caps.begin(); iter != requires_caps.end(); iter++) {
794 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
796 MIL <<
"Requires " << *iter << endl;
799 for (CapabilitySet::const_iterator iter = conflict_caps.begin(); iter != conflict_caps.end(); iter++) {
802 MIL <<
"Conflicts " << *iter << endl;
812 bool ret =
solving(requires_caps, conflict_caps);
814 (ret?
MIL:
WAR) <<
"SATResolver::resolvePool() done. Ret:" << ret << endl;
823 MIL <<
"SATResolver::resolvQueue()" << endl;
829 for (SolverQueueItemList::const_iterator iter = requestQueue.begin(); iter != requestQueue.end(); iter++) {
835 Id
id = (*iter)->satSolvable().id();
837 ERR <<
"Install: " << *iter <<
" not found" << endl;
839 MIL <<
"Install " << *iter << endl;
840 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
846 MIL <<
"Delete " << *iter << ident << endl;
860 MIL <<
"SATResolver::resolveQueue() done. Ret:" << ret << endl;
867 MIL <<
"SATResolver::doUpdate()" << endl;
881 queue_push( &(
_jobQueue), SOLVER_VERIFY|SOLVER_SOLVABLE_ALL);
885 queue_push( &(
_jobQueue), SOLVER_UPDATE|SOLVER_SOLVABLE_ALL);
889 queue_push( &(
_jobQueue), SOLVER_DISTUPGRADE|SOLVER_SOLVABLE_ALL);
893 queue_push( &(
_jobQueue), SOLVER_DROP_ORPHANED|SOLVER_SOLVABLE_ALL);
908 MIL <<
"Starting solving for update...." << endl;
911 MIL <<
"....Solver end" << endl;
918 queue_init(&decisionq);
919 solver_get_decisionqueue(
_solv, &decisionq);
920 for (
int i = 0; i < decisionq.count; i++)
923 p = decisionq.elements[i];
933 ERR <<
"id " << p <<
" not found in ZYPP pool." << endl;
936 queue_free(&decisionq);
939 for (
int i =
_solv->pool->installed->start; i < _solv->
pool->installed->start +
_solv->pool->installed->nsolvables; i++)
941 if (solver_get_decisionlevel(
_solv, i) > 0)
951 functor::functorRef<bool,PoolItem> (info) );
959 ERR <<
"id " << i <<
" not found in ZYPP pool." << endl;
962 MIL <<
"SATResolver::doUpdate() done" << endl;
982 : problemSolution (p)
1027 Id dep, source, target;
1034 probr = solver_findproblemrule(
_solv, problem);
1035 switch (solver_ruleinfo(
_solv, probr, &source, &target, &dep))
1037 case SOLVER_RULE_DISTUPGRADE:
1039 ret =
str::form (
_(
"%s does not belong to a distupgrade repository"), s.
asString().c_str());
1041 case SOLVER_RULE_INFARCH:
1045 case SOLVER_RULE_UPDATE:
1049 case SOLVER_RULE_JOB:
1050 ret =
_(
"conflicting requests");
1052 case SOLVER_RULE_RPM:
1053 ret =
_(
"some dependency problem");
1055 case SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP:
1056 ret =
str::form (
_(
"nothing provides requested %s"), pool_dep2str(pool, dep));
1057 detail +=
_(
"Have you enabled all requested repositories?");
1059 case SOLVER_RULE_JOB_UNKNOWN_PACKAGE:
1060 ret =
str::form (
_(
"package %s does not exist"), pool_dep2str(pool, dep));
1061 detail +=
_(
"Have you enabled all requested repositories?");
1063 case SOLVER_RULE_JOB_UNSUPPORTED:
1064 ret =
_(
"unsupported request");
1066 case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
1067 ret =
str::form (
_(
"%s is provided by the system and cannot be erased"), pool_dep2str(pool, dep));
1069 case SOLVER_RULE_RPM_NOT_INSTALLABLE:
1073 case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
1076 ret =
str::form (
_(
"nothing provides %s needed by %s"), pool_dep2str(pool, dep), s.
asString().c_str());
1078 case SOLVER_RULE_RPM_SAME_NAME:
1083 case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
1086 ret =
str::form (
_(
"%s conflicts with %s provided by %s"), s.
asString().c_str(), pool_dep2str(pool, dep), s2.
asString().c_str());
1088 case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
1093 case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
1096 ret =
str::form (
_(
"installed %s obsoletes %s provided by %s"), s.
asString().c_str(), pool_dep2str(pool, dep), s2.
asString().c_str());
1098 case SOLVER_RULE_RPM_SELF_CONFLICT:
1100 ret =
str::form (
_(
"solvable %s conflicts with %s provided by itself"), s.
asString().c_str(), pool_dep2str(pool, dep));
1102 case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
1109 typedef list<PoolItem> ProviderList;
1110 ProviderList providerlistInstalled, providerlistUninstalled;
1111 for_( iter1, possibleProviders.
begin(), possibleProviders.
end() ) {
1115 for_( iter2, possibleProviders.
begin(), possibleProviders.
end() ) {
1126 providerlistInstalled.push_back(provider1);
1128 providerlistUninstalled.push_back(provider1);
1132 ret =
str::form (
_(
"%s requires %s, but this requirement cannot be provided"), s.
asString().c_str(), pool_dep2str(pool, dep));
1133 if (providerlistInstalled.size() > 0) {
1134 detail +=
_(
"deleted providers: ");
1135 for (ProviderList::const_iterator iter = providerlistInstalled.begin(); iter != providerlistInstalled.end(); iter++) {
1136 if (iter == providerlistInstalled.begin())
1142 if (providerlistUninstalled.size() > 0) {
1143 if (detail.size() > 0)
1144 detail +=
_(
"\nuninstallable providers: ");
1146 detail =
_(
"uninstallable providers: ");
1147 for (ProviderList::const_iterator iter = providerlistUninstalled.begin(); iter != providerlistUninstalled.end(); iter++) {
1148 if (iter == providerlistUninstalled.begin())
1168 Id problem, solution, element;
1174 MIL <<
"Encountered problems! Here are the solutions:\n" << endl;
1177 while ((problem = solver_next_problem(
_solv, problem)) != 0) {
1178 MIL <<
"Problem " << pcnt++ <<
":" << endl;
1179 MIL <<
"====================================" << endl;
1183 MIL << whatString << endl;
1184 MIL <<
"------------------------------------" << endl;
1185 ResolverProblem_Ptr resolverProblem =
new ResolverProblem (whatString, detail);
1188 while ((solution = solver_next_solution(
_solv, problem, solution)) != 0) {
1191 while ((element = solver_next_solutionelement(
_solv, problem, solution, element, &p, &rp)) != 0) {
1192 if (p == SOLVER_SOLUTION_JOB) {
1195 switch (
_jobQueue.elements[rp-1]&(SOLVER_SELECTMASK|SOLVER_JOBMASK))
1197 case SOLVER_INSTALL | SOLVER_SOLVABLE: {
1201 if (pool->installed && s.
get()->repo == pool->installed) {
1203 string description =
str::form (
_(
"do not keep %s installed"), s.
asString().c_str() );
1204 MIL << description << endl;
1209 MIL << description << endl;
1213 ERR <<
"SOLVER_INSTALL_SOLVABLE: No item found for " << s.
asString() << endl;
1217 case SOLVER_ERASE | SOLVER_SOLVABLE: {
1221 if (pool->installed && s.
get()->repo == pool->installed) {
1224 MIL << description << endl;
1228 string description =
str::form (
_(
"do not forbid installation of %s"),
itemToString( poolItem ).c_str());
1229 MIL << description << endl;
1233 ERR <<
"SOLVER_ERASE_SOLVABLE: No item found for " << s.
asString() << endl;
1237 case SOLVER_INSTALL | SOLVER_SOLVABLE_NAME:
1240 SolverQueueItemInstall_Ptr install =
1244 string description =
str::form (
_(
"do not install %s"), ident.
c_str() );
1245 MIL << description << endl;
1249 case SOLVER_ERASE | SOLVER_SOLVABLE_NAME:
1259 functor::functorRef<bool,PoolItem> (info) );
1261 SolverQueueItemDelete_Ptr del =
1266 MIL << description << endl;
1270 case SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES:
1273 string description =
"";
1276 if (system_requires.find(
Capability(what)) != system_requires.end()) {
1278 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1279 resolverProblem->setDescription(
_(
"This request will break your system!"));
1280 description =
_(
"ignore the warning of a broken system");
1281 description += string(
" (requires:")+pool_dep2str(pool, what)+
")";
1282 MIL << description << endl;
1285 description =
str::form (
_(
"do not ask to install a solvable providing %s"), pool_dep2str(pool, what));
1286 MIL << description << endl;
1291 case SOLVER_ERASE | SOLVER_SOLVABLE_PROVIDES:
1294 string description =
"";
1297 if (system_conflicts.find(
Capability(what)) != system_conflicts.end()) {
1299 resolverProblem->setDetails( resolverProblem->description() +
"\n" + resolverProblem->details() );
1300 resolverProblem->setDescription(
_(
"This request will break your system!"));
1301 description =
_(
"ignore the warning of a broken system");
1302 description += string(
" (conflicts:")+pool_dep2str(pool, what)+
")";
1303 MIL << description << endl;
1307 description =
str::form (
_(
"do not ask to delete all solvables providing %s"), pool_dep2str(pool, what));
1308 MIL << description << endl;
1313 case SOLVER_UPDATE | SOLVER_SOLVABLE:
1318 if (pool->installed && s.
get()->repo == pool->installed) {
1320 string description =
str::form (
_(
"do not install most recent version of %s"), s.
asString().c_str());
1321 MIL << description << endl;
1324 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE " << poolItem <<
" is not selected for installation" << endl;
1327 ERR <<
"SOLVER_INSTALL_SOLVABLE_UPDATE: No item found for " << s.
asString() << endl;
1332 MIL <<
"- do something different" << endl;
1333 ERR <<
"No valid solution available" << endl;
1336 }
else if (p == SOLVER_SOLUTION_INFARCH) {
1339 if (pool->installed && s.
get()->repo == pool->installed) {
1341 string description =
str::form (
_(
"keep %s despite the inferior architecture"), s.
asString().c_str());
1342 MIL << description << endl;
1346 string description =
str::form (
_(
"install %s despite the inferior architecture"), s.
asString().c_str());
1347 MIL << description << endl;
1350 }
else if (p == SOLVER_SOLUTION_DISTUPGRADE) {
1353 if (pool->installed && s.
get()->repo == pool->installed) {
1356 MIL << description << endl;
1360 string description =
str::form (
_(
"install %s from excluded repository"), s.
asString().c_str());
1361 MIL << description << endl;
1374 if (itemFrom && itemTo) {
1376 int illegal = policy_is_illegal(
_solv, s.
get(), sd.
get(), 0);
1378 if ((illegal & POLICY_ILLEGAL_DOWNGRADE) != 0)
1381 MIL << description << endl;
1385 if ((illegal & POLICY_ILLEGAL_ARCHCHANGE) != 0)
1388 MIL << description << endl;
1392 if ((illegal & POLICY_ILLEGAL_VENDORCHANGE) != 0)
1396 string description =
str::form (
_(
"install %s (with vendor change)\n %s --> %s") ,
1398 ( s_vendor ? s_vendor.c_str() :
" (no vendor) " ),
1399 ( sd_vendor ? sd_vendor.c_str() :
" (no vendor) " ) );
1400 MIL << description << endl;
1406 MIL << description << endl;
1417 MIL << description << endl;
1424 resolverProblem->addSolution (problemSolution,
1425 problemSolution->
actionCount() > 1 ?
true :
false);
1426 MIL <<
"------------------------------------" << endl;
1433 resolverProblem->addSolution (problemSolution,
1435 MIL <<
"ignore some dependencies of " << item << endl;
1436 MIL <<
"------------------------------------" << endl;
1440 resolverProblems.push_back (resolverProblem);
1443 return resolverProblems;
1449 for (ProblemSolutionList::const_iterator iter = solutions.begin();
1450 iter != solutions.end(); ++iter) {
1451 ProblemSolution_Ptr solution = *iter;
1453 if (!solution->apply (dummyResolver))
1462 if (iter->status().isInstalled()) {
1463 MIL <<
"Lock installed item " << *iter << endl;
1464 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE );
1467 MIL <<
"Lock NOT installed item " << *iter << endl;
1477 std::set<IdString> unifiedByName;
1479 IdString ident( (*iter)->satSolvable().ident() );
1480 if ( unifiedByName.insert( ident ).second )
1484 MIL <<
"Keep NOT installed name " << ident <<
" (" << *iter <<
")" << endl;
1497 for (CapabilitySet::const_iterator iter = system_requires.begin(); iter != system_requires.end(); ++iter) {
1498 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_PROVIDES );
1500 MIL <<
"SYSTEM Requires " << *iter << endl;
1503 for (CapabilitySet::const_iterator iter = system_conflicts.begin(); iter != system_conflicts.end(); ++iter) {
1506 MIL <<
"SYSTEM Conflicts " << *iter << endl;
1517 if ( (*it)->isSystem() )
1520 queue_push( &(
_jobQueue), SOLVER_INSTALL | SOLVER_SOLVABLE_NAME | SOLVER_ESSENTIAL );
1521 queue_push( &(
_jobQueue), archrule.id() );
1532 ::solver_get_userinstalled(
_solv, ret, GET_USERINSTALLED_NAMES|GET_USERINSTALLED_INVERTED );
1540 ::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)
#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)
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.