Long overdue as we support debian/haiku/arch since a long time now.
No ABI change, as we have legacy defines.
%extend Solver {
static const int SOLVER_RULE_UNKNOWN = SOLVER_RULE_UNKNOWN;
- static const int SOLVER_RULE_RPM = SOLVER_RULE_RPM;
- static const int SOLVER_RULE_RPM_NOT_INSTALLABLE = SOLVER_RULE_RPM_NOT_INSTALLABLE;
- static const int SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP = SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP;
- static const int SOLVER_RULE_RPM_PACKAGE_REQUIRES = SOLVER_RULE_RPM_PACKAGE_REQUIRES;
- static const int SOLVER_RULE_RPM_SELF_CONFLICT = SOLVER_RULE_RPM_SELF_CONFLICT;
- static const int SOLVER_RULE_RPM_PACKAGE_CONFLICT = SOLVER_RULE_RPM_PACKAGE_CONFLICT;
- static const int SOLVER_RULE_RPM_SAME_NAME = SOLVER_RULE_RPM_SAME_NAME;
- static const int SOLVER_RULE_RPM_PACKAGE_OBSOLETES = SOLVER_RULE_RPM_PACKAGE_OBSOLETES;
- static const int SOLVER_RULE_RPM_IMPLICIT_OBSOLETES = SOLVER_RULE_RPM_IMPLICIT_OBSOLETES;
- static const int SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES = SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES;
+ static const int SOLVER_RULE_PKG = SOLVER_RULE_PKG;
+ static const int SOLVER_RULE_PKG_NOT_INSTALLABLE = SOLVER_RULE_PKG_NOT_INSTALLABLE;
+ static const int SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP = SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP;
+ static const int SOLVER_RULE_PKG_REQUIRES = SOLVER_RULE_PKG_REQUIRES;
+ static const int SOLVER_RULE_PKG_SELF_CONFLICT = SOLVER_RULE_PKG_SELF_CONFLICT;
+ static const int SOLVER_RULE_PKG_CONFLICTS = SOLVER_RULE_PKG_CONFLICTS;
+ static const int SOLVER_RULE_PKG_SAME_NAME = SOLVER_RULE_PKG_SAME_NAME;
+ static const int SOLVER_RULE_PKG_OBSOLETES = SOLVER_RULE_PKG_OBSOLETES;
+ static const int SOLVER_RULE_PKG_IMPLICIT_OBSOLETES = SOLVER_RULE_PKG_IMPLICIT_OBSOLETES;
+ static const int SOLVER_RULE_PKG_INSTALLED_OBSOLETES = SOLVER_RULE_PKG_INSTALLED_OBSOLETES;
static const int SOLVER_RULE_UPDATE = SOLVER_RULE_UPDATE;
static const int SOLVER_RULE_FEATURE = SOLVER_RULE_FEATURE;
static const int SOLVER_RULE_JOB = SOLVER_RULE_JOB;
static const int SOLVER_REASON_RECOMMENDED = SOLVER_REASON_RECOMMENDED;
static const int SOLVER_REASON_SUPPLEMENTED = SOLVER_REASON_SUPPLEMENTED;
+ /* legacy */
+ static const int SOLVER_RULE_RPM = SOLVER_RULE_RPM;
+
~Solver() {
solver_free($self);
}
.\" Title: Libsolv-Bindings
.\" Author: [see the "Author" section]
.\" Generator: DocBook XSL Stylesheets v1.78.0 <http://docbook.sf.net/>
-.\" Date: 09/24/2014
+.\" Date: 09/29/2014
.\" Manual: LIBSOLV
.\" Source: libsolv
.\" Language: English
.\"
-.TH "LIBSOLV\-BINDINGS" "3" "09/24/2014" "libsolv" "LIBSOLV"
+.TH "LIBSOLV\-BINDINGS" "3" "09/29/2014" "libsolv" "LIBSOLV"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
A rule of an unknown class\&. You should never encounter those\&.
.RE
.PP
-\fBSOLVER_RULE_RPM\fR
+\fBSOLVER_RULE_PKG\fR
.RS 4
-A package dependency rule, called rpm rule for historical reasons\&.
+A package dependency rule\&.
.RE
.PP
\fBSOLVER_RULE_UPDATE\fR
.sp
Special dependency rule types:
.PP
-\fBSOLVER_RULE_RPM_NOT_INSTALLABLE\fR
+\fBSOLVER_RULE_PKG_NOT_INSTALLABLE\fR
.RS 4
This rule was added to prevent the installation of a package of an architecture that does not work on the system\&.
.RE
.PP
-\fBSOLVER_RULE_RPM_NOTHING_PROVIDES_DEP\fR
+\fBSOLVER_RULE_PKG_NOTHING_PROVIDES_DEP\fR
.RS 4
The package contains a required dependency which was not provided by any package\&.
.RE
.PP
-\fBSOLVER_RULE_RPM_PACKAGE_REQUIRES\fR
+\fBSOLVER_RULE_PKG_REQUIRES\fR
.RS 4
-Similar to SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP, but in this case some packages provided the dependency but none of them could be installed due to other dependency issues\&.
+Similar to SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP, but in this case some packages provided the dependency but none of them could be installed due to other dependency issues\&.
.RE
.PP
-\fBSOLVER_RULE_RPM_SELF_CONFLICT\fR
+\fBSOLVER_RULE_PKG_SELF_CONFLICT\fR
.RS 4
The package conflicts with itself\&. This is not allowed by older rpm versions\&.
.RE
.PP
-\fBSOLVER_RULE_RPM_PACKAGE_CONFLICT\fR
+\fBSOLVER_RULE_PKG_CONFLICTS\fR
.RS 4
To fulfill the dependencies two packages need to be installed, but one of the packages contains a conflict with the other one\&.
.RE
.PP
-\fBSOLVER_RULE_RPM_SAME_NAME\fR
+\fBSOLVER_RULE_PKG_SAME_NAME\fR
.RS 4
The dependencies can only be fulfilled by multiple versions of a package, but installing multiple versions of the same package is not allowed\&.
.RE
.PP
-\fBSOLVER_RULE_RPM_PACKAGE_OBSOLETES\fR
+\fBSOLVER_RULE_PKG_OBSOLETES\fR
.RS 4
To fulfill the dependencies two packages need to be installed, but one of the packages obsoletes the other one\&.
.RE
.PP
-\fBSOLVER_RULE_RPM_IMPLICIT_OBSOLETES\fR
+\fBSOLVER_RULE_PKG_IMPLICIT_OBSOLETES\fR
.RS 4
To fulfill the dependencies two packages need to be installed, but one of the packages has provides a dependency that is obsoleted by the other one\&. See the POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES flag\&.
.RE
.PP
-\fBSOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES\fR
+\fBSOLVER_RULE_PKG_INSTALLED_OBSOLETES\fR
.RS 4
To fulfill the dependencies a package needs to be installed that is obsoleted by an installed package\&. See the POOL_FLAG_NOINSTALLEDOBSOLETES flag\&.
.RE
*SOLVER_RULE_UNKNOWN*::
A rule of an unknown class. You should never encounter those.
-*SOLVER_RULE_RPM*::
-A package dependency rule, called rpm rule for historical reasons.
+*SOLVER_RULE_PKG*::
+A package dependency rule.
*SOLVER_RULE_UPDATE*::
A rule to implement the update policy of installed packages. Every
Special dependency rule types:
-*SOLVER_RULE_RPM_NOT_INSTALLABLE*::
+*SOLVER_RULE_PKG_NOT_INSTALLABLE*::
This rule was added to prevent the installation of a package of an
architecture that does not work on the system.
-*SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP*::
+*SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP*::
The package contains a required dependency which was not provided by
any package.
-*SOLVER_RULE_RPM_PACKAGE_REQUIRES*::
-Similar to SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP, but in this case
+*SOLVER_RULE_PKG_REQUIRES*::
+Similar to SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP, but in this case
some packages provided the dependency but none of them could be
installed due to other dependency issues.
-*SOLVER_RULE_RPM_SELF_CONFLICT*::
+*SOLVER_RULE_PKG_SELF_CONFLICT*::
The package conflicts with itself. This is not allowed by older rpm
versions.
-*SOLVER_RULE_RPM_PACKAGE_CONFLICT*::
+*SOLVER_RULE_PKG_CONFLICTS*::
To fulfill the dependencies two packages need to be installed, but
one of the packages contains a conflict with the other one.
-*SOLVER_RULE_RPM_SAME_NAME*::
+*SOLVER_RULE_PKG_SAME_NAME*::
The dependencies can only be fulfilled by multiple versions of
a package, but installing multiple versions of the same package
is not allowed.
-*SOLVER_RULE_RPM_PACKAGE_OBSOLETES*::
+*SOLVER_RULE_PKG_OBSOLETES*::
To fulfill the dependencies two packages need to be installed, but
one of the packages obsoletes the other one.
-*SOLVER_RULE_RPM_IMPLICIT_OBSOLETES*::
+*SOLVER_RULE_PKG_IMPLICIT_OBSOLETES*::
To fulfill the dependencies two packages need to be installed, but
one of the packages has provides a dependency that is obsoleted
by the other one. See the POOL_FLAG_IMPLICITOBSOLETEUSESPROVIDES
flag.
-*SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES*::
+*SOLVER_RULE_PKG_INSTALLED_OBSOLETES*::
To fulfill the dependencies a package needs to be installed that is
obsoleted by an installed package. See the POOL_FLAG_NOINSTALLEDOBSOLETES
flag.
}
else
{
- assert(rid < solv->rpmrules_end);
+ assert(rid < solv->pkgrules_end);
r = solv->rules + rid;
d = r->d < 0 ? -r->d - 1 : r->d;
if (!d && r->w2 < 0)
return pool_tmpjoin(pool, "package ", pool_dep2str(pool, dep), " does not exist");
case SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM:
return pool_tmpjoin(pool, pool_dep2str(pool, dep), " is provided by the system", 0);
- case SOLVER_RULE_RPM:
+ case SOLVER_RULE_PKG:
return "some dependency problem";
case SOLVER_RULE_BEST:
if (source > 0)
return pool_tmpjoin(pool, "cannot install the best update candidate for package ", pool_solvid2str(pool, source), 0);
return "cannot install the best candidate for the job";
- case SOLVER_RULE_RPM_NOT_INSTALLABLE:
+ case SOLVER_RULE_PKG_NOT_INSTALLABLE:
return pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), " is not installable");
- case SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP:
+ case SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP:
s = pool_tmpjoin(pool, "nothing provides ", pool_dep2str(pool, dep), 0);
return pool_tmpappend(pool, s, " needed by ", pool_solvid2str(pool, source));
- case SOLVER_RULE_RPM_SAME_NAME:
+ case SOLVER_RULE_PKG_SAME_NAME:
s = pool_tmpjoin(pool, "cannot install both ", pool_solvid2str(pool, source), 0);
return pool_tmpappend(pool, s, " and ", pool_solvid2str(pool, target));
- case SOLVER_RULE_RPM_PACKAGE_CONFLICT:
+ case SOLVER_RULE_PKG_CONFLICTS:
s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), 0);
s = pool_tmpappend(pool, s, " conflicts with ", pool_dep2str(pool, dep));
return pool_tmpappend(pool, s, " provided by ", pool_solvid2str(pool, target));
- case SOLVER_RULE_RPM_PACKAGE_OBSOLETES:
+ case SOLVER_RULE_PKG_OBSOLETES:
s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), 0);
s = pool_tmpappend(pool, s, " obsoletes ", pool_dep2str(pool, dep));
return pool_tmpappend(pool, s, " provided by ", pool_solvid2str(pool, target));
- case SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES:
+ case SOLVER_RULE_PKG_INSTALLED_OBSOLETES:
s = pool_tmpjoin(pool, "installed package ", pool_solvid2str(pool, source), 0);
s = pool_tmpappend(pool, s, " obsoletes ", pool_dep2str(pool, dep));
return pool_tmpappend(pool, s, " provided by ", pool_solvid2str(pool, target));
- case SOLVER_RULE_RPM_IMPLICIT_OBSOLETES:
+ case SOLVER_RULE_PKG_IMPLICIT_OBSOLETES:
s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), 0);
s = pool_tmpappend(pool, s, " implicitly obsoletes ", pool_dep2str(pool, dep));
return pool_tmpappend(pool, s, " provided by ", pool_solvid2str(pool, target));
- case SOLVER_RULE_RPM_PACKAGE_REQUIRES:
+ case SOLVER_RULE_PKG_REQUIRES:
s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), " requires ");
return pool_tmpappend(pool, s, pool_dep2str(pool, dep), ", but none of the providers can be installed");
- case SOLVER_RULE_RPM_SELF_CONFLICT:
+ case SOLVER_RULE_PKG_SELF_CONFLICT:
s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), " conflicts with ");
return pool_tmpappend(pool, s, pool_dep2str(pool, dep), " provided by itself");
case SOLVER_RULE_YUMOBS:
#define RULES_BLOCK 63
-static void addrpmruleinfo(Solver *solv, Id p, Id d, int type, Id dep);
+static void addpkgruleinfo(Solver *solv, Id p, Id d, int type, Id dep);
static void solver_createcleandepsmap(Solver *solv, Map *cleandepsmap, int unneeded);
/*-------------------------------------------------------------------
* Check if dependency is possible
*
* mirrors solver_dep_fulfilled but uses map m instead of the decisionmap.
- * used in solver_addrpmrulesforweak and solver_createcleandepsmap.
+ * used in solver_addpkgrulesforweak and solver_createcleandepsmap.
*/
static inline int
/*
* add rule
- * p = direct literal; always < 0 for installed rpm rules
+ * p = direct literal; always < 0 for installed pkg rules
* d, if < 0 direct literal, if > 0 offset into whatprovides, if == 0 rule is assertion (look at p only)
*
*
* Binary rule: p = first literal, d = 0, w2 = second literal, w1 = p
* every other : w1 = p, w2 = whatprovidesdata[d];
*
- * always returns a rule for non-rpm rules
+ * always returns a rule for non-pkg rules
*/
Rule *
>1 = multi-literal rule
*/
- /* it often happenes that requires lead to adding the same rpm rule
+ /* it often happenes that requires lead to adding the same pkg rule
* multiple times, so we prune those duplicates right away to make
* the work for unifyrules a bit easier */
- if (!solv->rpmrules_end) /* we add rpm rules */
+ if (!solv->pkgrules_end) /* we add pkg rules */
{
r = solv->rules + solv->nrules - 1; /* get the last added rule */
if (r->p == p && r->d == d && (d != 0 || !r->w2))
d = dp[-1];
}
- if (n == 1 && p > d && !solv->rpmrules_end)
+ if (n == 1 && p > d && !solv->pkgrules_end)
{
/* put smallest literal first so we can find dups */
n = p; p = d; d = n; /* p <-> d */
}
/*
- * check for duplicate (r is only set if we're adding rpm rules)
+ * check for duplicate (r is only set if we're adding pkg rules)
*/
if (r)
{
/******************************************************************************
***
- *** rpm rule part: create rules representing the package dependencies
+ *** pkg rule part: create rules representing the package dependencies
***
***/
}
static inline void
-addrpmrule(Solver *solv, Id p, Id d, int type, Id dep)
+addpkgrule(Solver *solv, Id p, Id d, int type, Id dep)
{
if (!solv->ruleinfoq)
solver_addrule(solv, p, d);
else
- addrpmruleinfo(solv, p, d, type, dep);
+ addpkgruleinfo(solv, p, d, type, dep);
}
#ifdef ENABLE_LINKED_PKGS
#endif
if (qr->count == 1)
- addrpmrule(solv, qr->elements[0], -(s - pool->solvables), SOLVER_RULE_RPM_PACKAGE_REQUIRES, req);
+ addpkgrule(solv, qr->elements[0], -(s - pool->solvables), SOLVER_RULE_PKG_REQUIRES, req);
else
- addrpmrule(solv, -(s - pool->solvables), pool_queuetowhatprovides(pool, qr), SOLVER_RULE_RPM_PACKAGE_REQUIRES, req);
+ addpkgrule(solv, -(s - pool->solvables), pool_queuetowhatprovides(pool, qr), SOLVER_RULE_PKG_REQUIRES, req);
if (qp->count > 1)
{
Id d = pool_queuetowhatprovides(pool, qp);
for (i = 0; i < qr->count; i++)
- addrpmrule(solv, -qr->elements[i], d, SOLVER_RULE_RPM_PACKAGE_REQUIRES, prv);
+ addpkgrule(solv, -qr->elements[i], d, SOLVER_RULE_PKG_REQUIRES, prv);
}
else if (qp->count)
{
for (i = 0; i < qr->count; i++)
- addrpmrule(solv, qp->elements[0], -qr->elements[i], SOLVER_RULE_RPM_PACKAGE_REQUIRES, prv);
+ addpkgrule(solv, qp->elements[0], -qr->elements[i], SOLVER_RULE_PKG_REQUIRES, prv);
}
if (!m)
- return; /* nothing more to do if called from getrpmruleinfos() */
+ return; /* nothing more to do if called from getpkgruleinfos() */
for (i = 0; i < qr->count; i++)
if (!MAPTST(m, qr->elements[i]))
queue_push(workq, qr->elements[i]);
queue_init(&bq);
/* CNF expansion for requires, DNF + INVERT expansion for conflicts */
- i = pool_normalize_complex_dep(pool, dep, &bq, type == SOLVER_RULE_RPM_PACKAGE_REQUIRES ? 0 : (CPLXDEPS_TODNF | CPLXDEPS_EXPAND | CPLXDEPS_INVERT));
+ i = pool_normalize_complex_dep(pool, dep, &bq, type == SOLVER_RULE_DEP_PACKAGE_REQUIRES ? 0 : (CPLXDEPS_TODNF | CPLXDEPS_EXPAND | CPLXDEPS_INVERT));
/* handle special cases */
if (i == 0)
{
else
{
POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "package %s [%d] is not installable (%s)\n", pool_solvid2str(pool, p), p, pool_dep2str(pool, dep));
- addrpmrule(solv, -p, 0, type == SOLVER_RULE_RPM_PACKAGE_REQUIRES ? SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP : type, dep);
+ addpkgrule(solv, -p, 0, type == SOLVER_RULE_PKG_REQUIRES ? SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP : type, dep);
}
queue_free(&bq);
return;
{
/* nothing provides req! */
POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "package %s [%d] is not installable (%s)\n", pool_solvid2str(pool, p), p, pool_dep2str(pool, dep));
- addrpmrule(solv, -p, 0, SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP, dep);
+ addpkgrule(solv, -p, 0, SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP, dep);
continue;
}
- addrpmrule(solv, -p, dp - pool->whatprovidesdata, SOLVER_RULE_RPM_PACKAGE_REQUIRES, dep);
+ addpkgrule(solv, -p, dp - pool->whatprovidesdata, SOLVER_RULE_PKG_REQUIRES, dep);
/* push all non-visited providers on the work queue */
if (m)
for (; *dp; dp++)
continue;
if (-p == p2)
{
- if (type == SOLVER_RULE_RPM_PACKAGE_CONFLICT)
+ if (type == SOLVER_RULE_PKG_CONFLICTS)
{
if (pool->forbidselfconflicts && !is_otherproviders_dep(pool, dep))
- addrpmrule(solv, -p, 0, SOLVER_RULE_RPM_SELF_CONFLICT, dep);
+ addpkgrule(solv, -p, 0, SOLVER_RULE_PKG_SELF_CONFLICT, dep);
continue;
}
- addrpmrule(solv, -p, 0, type, dep);
+ addpkgrule(solv, -p, 0, type, dep);
continue;
}
if (p2 > 0)
- addrpmrule(solv, p2, -p, type, dep); /* hack so that we don't need pool_queuetowhatprovides */
+ addpkgrule(solv, p2, -p, type, dep); /* hack so that we don't need pool_queuetowhatprovides */
else
- addrpmrule(solv, -p, p2, type, dep);
+ addpkgrule(solv, -p, p2, type, dep);
if (m && p2 > 0 && !MAPTST(m, p2))
queue_push(workq, p2);
}
memset(&q, 0, sizeof(q));
q.count = qcnt - 1;
q.elements = qele + 1;
- addrpmrule(solv, qele[0], pool_queuetowhatprovides(pool, &q), type, dep);
+ addpkgrule(solv, qele[0], pool_queuetowhatprovides(pool, &q), type, dep);
if (m)
for (j = 0; j < qcnt; j++)
if (qele[j] > 0 && !MAPTST(m, qele[j]))
*/
void
-solver_addrpmrulesforsolvable(Solver *solv, Solvable *s, Map *m)
+solver_addpkgrulesforsolvable(Solver *solv, Solvable *s, Map *m)
{
Pool *pool = solv->pool;
Repo *installed = solv->installed;
dontfix = 0;
if (installed /* Installed system available */
&& s->repo == installed /* solvable is installed */
- && !solv->fixmap_all /* NOT repair errors in rpm dependency graph */
+ && !solv->fixmap_all /* NOT repair errors in dependency graph */
&& !(solv->fixmap.size && MAPTST(&solv->fixmap, n - installed->start)))
{
- dontfix = 1; /* dont care about broken rpm deps */
+ dontfix = 1; /* dont care about broken deps */
}
if (!dontfix)
: !pool_installable(pool, s))
{
POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "package %s [%d] is not installable\n", pool_solvid2str(pool, n), n);
- addrpmrule(solv, -n, 0, SOLVER_RULE_RPM_NOT_INSTALLABLE, 0);
+ addpkgrule(solv, -n, 0, SOLVER_RULE_PKG_NOT_INSTALLABLE, 0);
}
}
if (pool_is_complex_dep(pool, req))
{
/* we have AND/COND deps, normalize */
- add_complex_deprules(solv, n, req, SOLVER_RULE_RPM_PACKAGE_REQUIRES, dontfix, &workq, m);
+ add_complex_deprules(solv, n, req, SOLVER_RULE_PKG_REQUIRES, dontfix, &workq, m);
continue;
}
#endif
if (!*dp)
{
POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "package %s [%d] is not installable (%s)\n", pool_solvid2str(pool, n), n, pool_dep2str(pool, req));
- addrpmrule(solv, -n, 0, SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP, req);
+ addpkgrule(solv, -n, 0, SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP, req);
continue;
}
/* add 'requires' dependency */
/* rule: (-requestor|provider1|provider2|...|providerN) */
- addrpmrule(solv, -n, dp - pool->whatprovidesdata, SOLVER_RULE_RPM_PACKAGE_REQUIRES, req);
+ addpkgrule(solv, -n, dp - pool->whatprovidesdata, SOLVER_RULE_PKG_REQUIRES, req);
/* push all non-visited providers on the work queue */
if (m)
if (!ispatch && pool_is_complex_dep(pool, con))
{
/* we have AND/COND deps, normalize */
- add_complex_deprules(solv, n, con, SOLVER_RULE_RPM_PACKAGE_CONFLICT, dontfix, &workq, m);
+ add_complex_deprules(solv, n, con, SOLVER_RULE_PKG_CONFLICTS, dontfix, &workq, m);
continue;
}
#endif
{
if (!pool->forbidselfconflicts || is_otherproviders_dep(pool, con))
continue;
- addrpmrule(solv, -n, 0, SOLVER_RULE_RPM_SELF_CONFLICT, con);
+ addpkgrule(solv, -n, 0, SOLVER_RULE_PKG_SELF_CONFLICT, con);
continue;
}
if (ispatch && solv->multiversion.size && MAPTST(&solv->multiversion, p) && ISRELDEP(con))
p = -makemultiversionconflict(solv, p, con);
}
/* rule: -n|-p: either solvable _or_ provider of conflict */
- addrpmrule(solv, -n, p == SYSTEMSOLVABLE ? 0 : -p, SOLVER_RULE_RPM_PACKAGE_CONFLICT, con);
+ addpkgrule(solv, -n, p == SYSTEMSOLVABLE ? 0 : -p, SOLVER_RULE_PKG_CONFLICTS, con);
}
}
}
if (pool->obsoleteusescolors && !pool_colormatch(pool, s, ps))
continue;
if (!isinstalled)
- addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_PACKAGE_OBSOLETES, obs);
+ addpkgrule(solv, -n, -p, SOLVER_RULE_PKG_OBSOLETES, obs);
else
- addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES, obs);
+ addpkgrule(solv, -n, -p, SOLVER_RULE_PKG_INSTALLED_OBSOLETES, obs);
}
}
}
if (pool->implicitobsoleteusescolors && !pool_colormatch(pool, s, ps))
continue;
if (s->name == ps->name)
- addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_SAME_NAME, 0);
+ addpkgrule(solv, -n, -p, SOLVER_RULE_PKG_SAME_NAME, 0);
else
- addrpmrule(solv, -n, -p, SOLVER_RULE_RPM_IMPLICIT_OBSOLETES, s->name);
+ addpkgrule(solv, -n, -p, SOLVER_RULE_PKG_IMPLICIT_OBSOLETES, s->name);
}
}
}
#ifdef ENABLE_LINKED_PKGS
void
-solver_addrpmrulesforlinked(Solver *solv, Map *m)
+solver_addpkgrulesforlinked(Solver *solv, Map *m)
{
Pool *pool = solv->pool;
Solvable *s;
for (j = 0; j < qr.count; j++)
if (MAPTST(m, qr.elements[j]))
{
- solver_addrpmrulesforsolvable(solv, s, m);
+ solver_addpkgrulesforsolvable(solv, s, m);
break;
}
queue_empty(&qr);
*/
void
-solver_addrpmrulesforweak(Solver *solv, Map *m)
+solver_addpkgrulesforweak(Solver *solv, Map *m)
{
Pool *pool = solv->pool;
Solvable *s;
/* if nothing found, goto next solvables */
if (!sup)
continue;
- solver_addrpmrulesforsolvable(solv, s, m);
+ solver_addpkgrulesforsolvable(solv, s, m);
n = 0; /* check all solvables again because we added solvables to m */
}
}
*/
void
-solver_addrpmrulesforupdaters(Solver *solv, Solvable *s, Map *m, int allow_all)
+solver_addpkgrulesforupdaters(Solver *solv, Solvable *s, Map *m, int allow_all)
{
Pool *pool = solv->pool;
int i;
policy_findupdatepackages(solv, s, &qs, allow_all);
/* add rule for 's' if not already done */
if (!MAPTST(m, s - pool->solvables))
- solver_addrpmrulesforsolvable(solv, s, m);
+ solver_addpkgrulesforsolvable(solv, s, m);
/* foreach update candidate, add rule if not already done */
for (i = 0; i < qs.count; i++)
if (!MAPTST(m, qs.elements[i]))
- solver_addrpmrulesforsolvable(solv, pool->solvables + qs.elements[i], m);
+ solver_addpkgrulesforsolvable(solv, pool->solvables + qs.elements[i], m);
queue_free(&qs);
}
***/
static void
-addrpmruleinfo(Solver *solv, Id p, Id d, int type, Id dep)
+addpkgruleinfo(Solver *solv, Id p, Id d, int type, Id dep)
{
Pool *pool = solv->pool;
Rule *r;
return;
}
/* should use a different type instead */
- if (type == SOLVER_RULE_RPM_PACKAGE_CONFLICT && !w2)
+ if (type == SOLVER_RULE_PKG_CONFLICTS && !w2)
w2 = -SYSTEMSOLVABLE;
}
/* yep, rule matches. record info */
queue_push(solv->ruleinfoq, type);
- if (type == SOLVER_RULE_RPM_SAME_NAME)
+ if (type == SOLVER_RULE_PKG_SAME_NAME)
{
/* we normalize same name order */
queue_push(solv->ruleinfoq, op < 0 ? -op : 0);
}
static void
-getrpmruleinfos(Solver *solv, Rule *r, Queue *rq)
+getpkgruleinfos(Solver *solv, Rule *r, Queue *rq)
{
Pool *pool = solv->pool;
Id l, pp;
{
if (l >= 0)
break;
- solver_addrpmrulesforsolvable(solv, pool->solvables - l, 0);
+ solver_addpkgrulesforsolvable(solv, pool->solvables - l, 0);
}
#ifdef ENABLE_LINKED_PKGS
FOR_RULELITERALS(l, pp, r)
int i, j;
queue_empty(rq);
- if (rid <= 0 || rid >= solv->rpmrules_end)
+ if (rid <= 0 || rid >= solv->pkgrules_end)
{
Id type, from, to, dep;
type = solver_ruleinfo(solv, rid, &from, &to, &dep);
queue_push(rq, dep);
return 1;
}
- getrpmruleinfos(solv, r, rq);
+ getpkgruleinfos(solv, r, rq);
/* now sort & unify em */
if (!rq->count)
return 0;
*top = 0;
if (depp)
*depp = 0;
- if (rid > 0 && rid < solv->rpmrules_end)
+ if (rid > 0 && rid < solv->pkgrules_end)
{
Queue rq;
int i;
if (r->p >= 0)
- return SOLVER_RULE_RPM;
+ return SOLVER_RULE_PKG;
if (fromp)
*fromp = -r->p;
queue_init(&rq);
- getrpmruleinfos(solv, r, &rq);
- type = SOLVER_RULE_RPM;
+ getpkgruleinfos(solv, r, &rq);
+ type = SOLVER_RULE_PKG;
for (i = 0; i < rq.count; i += 4)
{
Id qt, qo, qp, qd;
qp = rq.elements[i + 1];
qo = rq.elements[i + 2];
qd = rq.elements[i + 3];
- if (type == SOLVER_RULE_RPM || type > qt)
+ if (type == SOLVER_RULE_PKG || type > qt)
{
type = qt;
if (fromp)
{
if (rid <= 0)
return SOLVER_RULE_UNKNOWN;
- if (rid > 0 && rid < solv->rpmrules_end)
- return SOLVER_RULE_RPM;
+ if (rid > 0 && rid < solv->pkgrules_end)
+ return SOLVER_RULE_PKG;
if (rid >= solv->jobrules && rid < solv->jobrules_end)
return SOLVER_RULE_JOB;
if (rid >= solv->updaterules && rid < solv->updaterules_end)
return;
}
now = solv_timems(0);
- solv->choicerules_ref = solv_calloc(solv->rpmrules_end, sizeof(Id));
+ solv->choicerules_ref = solv_calloc(solv->pkgrules_end, sizeof(Id));
queue_init(&q);
queue_init(&qi);
map_init(&m, pool->nsolvables);
lastaddedp = 0;
lastaddedd = 0;
lastaddedcnt = 0;
- for (rid = 1; rid < solv->rpmrules_end ; rid++)
+ for (rid = 1; rid < solv->pkgrules_end ; rid++)
{
r = solv->rules + rid;
if (r->p >= 0 || ((r->d == 0 || r->d == -1) && r->w2 <= 0))
continue;
MAPSET(&m, p - installed->start);
}
- for (rid = 1; rid < solv->rpmrules_end ; rid++)
+ for (rid = 1; rid < solv->pkgrules_end ; rid++)
{
Id p, *dp;
Rule *r = solv->rules + rid;
typedef enum {
SOLVER_RULE_UNKNOWN = 0,
- SOLVER_RULE_RPM = 0x100,
- SOLVER_RULE_RPM_NOT_INSTALLABLE,
- SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP,
- SOLVER_RULE_RPM_PACKAGE_REQUIRES,
- SOLVER_RULE_RPM_SELF_CONFLICT,
- SOLVER_RULE_RPM_PACKAGE_CONFLICT,
- SOLVER_RULE_RPM_SAME_NAME,
- SOLVER_RULE_RPM_PACKAGE_OBSOLETES,
- SOLVER_RULE_RPM_IMPLICIT_OBSOLETES,
- SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES,
+ SOLVER_RULE_PKG = 0x100,
+ SOLVER_RULE_PKG_NOT_INSTALLABLE,
+ SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP,
+ SOLVER_RULE_PKG_REQUIRES,
+ SOLVER_RULE_PKG_SELF_CONFLICT,
+ SOLVER_RULE_PKG_CONFLICTS,
+ SOLVER_RULE_PKG_SAME_NAME,
+ SOLVER_RULE_PKG_OBSOLETES,
+ SOLVER_RULE_PKG_IMPLICIT_OBSOLETES,
+ SOLVER_RULE_PKG_INSTALLED_OBSOLETES,
SOLVER_RULE_UPDATE = 0x200,
SOLVER_RULE_FEATURE = 0x300,
SOLVER_RULE_JOB = 0x400,
extern int solver_rulecmp(struct _Solver *solv, Rule *r1, Rule *r2);
extern void solver_shrinkrules(struct _Solver *solv, int nrules);
-/* rpm rules */
-extern void solver_addrpmrulesforsolvable(struct _Solver *solv, Solvable *s, Map *m);
-extern void solver_addrpmrulesforweak(struct _Solver *solv, Map *m);
-extern void solver_addrpmrulesforlinked(struct _Solver *solv, Map *m);
-extern void solver_addrpmrulesforupdaters(struct _Solver *solv, Solvable *s, Map *m, int allow_all);
+/* pkg rules */
+extern void solver_addpkgrulesforsolvable(struct _Solver *solv, Solvable *s, Map *m);
+extern void solver_addpkgrulesforweak(struct _Solver *solv, Map *m);
+extern void solver_addpkgrulesforlinked(struct _Solver *solv, Map *m);
+extern void solver_addpkgrulesforupdaters(struct _Solver *solv, Solvable *s, Map *m, int allow_all);
/* update/feature rules */
extern void solver_addupdaterule(struct _Solver *solv, Solvable *s, int allow_all);
extern void solver_breakorphans(struct _Solver *solv);
extern void solver_check_brokenorphanrules(struct _Solver *solv, Queue *dq);
+
+/* legacy */
+#define SOLVER_RULE_RPM SOLVER_RULE_PKG
+#define SOLVER_RULE_RPM_NOT_INSTALLABLE SOLVER_RULE_PKG_NOT_INSTALLABLE
+#define SOLVER_RULE_RPM_NOTHING_PROVIDES_DEP SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP
+#define SOLVER_RULE_RPM_PACKAGE_REQUIRES SOLVER_RULE_PKG_REQUIRES
+#define SOLVER_RULE_RPM_SELF_CONFLICT SOLVER_RULE_PKG_SELF_CONFLICT
+#define SOLVER_RULE_RPM_PACKAGE_CONFLICT SOLVER_RULE_PKG_CONFLICTS
+#define SOLVER_RULE_RPM_SAME_NAME SOLVER_RULE_PKG_SAME_NAME
+#define SOLVER_RULE_RPM_PACKAGE_OBSOLETES SOLVER_RULE_PKG_OBSOLETES
+#define SOLVER_RULE_RPM_IMPLICIT_OBSOLETES SOLVER_RULE_PKG_IMPLICIT_OBSOLETES
+#define SOLVER_RULE_RPM_INSTALLEDPKG_OBSOLETES SOLVER_RULE_PKG_INSTALLED_OBSOLETES
+
#ifdef __cplusplus
}
#endif
assert(solv->decisionq_why.elements[i] > 0);
/*
- * conflict with an rpm rule ?
+ * conflict with a pkg rule ?
*/
- if (solv->decisionq_why.elements[i] < solv->rpmrules_end)
+ if (solv->decisionq_why.elements[i] < solv->pkgrules_end)
{
if (record_proof)
{
else
queue_push(&solv->problems, 0);
assert(v > 0 || v == -SYSTEMSOLVABLE);
- POOL_DEBUG(SOLV_DEBUG_UNSOLVABLE, "conflict with rpm rule, disabling rule #%d\n", ri);
+ POOL_DEBUG(SOLV_DEBUG_UNSOLVABLE, "conflict with pkg rule, disabling rule #%d\n", ri);
if (ri >= solv->jobrules && ri < solv->jobrules_end)
v = -(solv->ruletojob.elements[ri - solv->jobrules] + 1);
else
/* lower half for removals, upper half for installs */
solv->watches = solv_calloc(2 * nsolvables, sizeof(Id));
#if 1
- /* do it reverse so rpm rules get triggered first (XXX: obsolete?) */
+ /* do it reverse so pkg rules get triggered first (XXX: obsolete?) */
for (i = 1, r = solv->rules + solv->nrules - 1; i < solv->nrules; i++, r--)
#else
for (i = 1, r = solv->rules + 1; i < solv->nrules; i++, r++)
if (MAPTST(&solv->weakrulemap, why))
if (!*lastweakp || why > *lastweakp)
*lastweakp = why;
- /* do not add rpm rules to problem */
- if (why < solv->rpmrules_end)
+ /* do not add pkg rules to problem */
+ if (why < solv->pkgrules_end)
return;
/* turn rule into problem */
if (why >= solv->jobrules && why < solv->jobrules_end)
*
* We know that the problem is not solvable. Record all involved
* rules (i.e. the "proof") into solv->learnt_pool.
- * Record the learnt pool index and all non-rpm rules into
+ * Record the learnt pool index and all non-pkg rules into
* solv->problems. (Our solutions to fix the problems are to
* disable those rules.)
*
int i;
Rule *r;
- for (i = 1, r = solv->rules + i; i < solv->rpmrules_end; i++, r++)
+ for (i = 1, r = solv->rules + i; i < solv->pkgrules_end; i++, r++)
{
if (r->p != -p)
continue;
Rule *r;
queue_empty(&solv->addedmap_deduceq);
- for (i = 2, j = solv->rpmrules_end - 1; i < pool->nsolvables && j > 0; j--)
+ for (i = 2, j = solv->pkgrules_end - 1; i < pool->nsolvables && j > 0; j--)
{
r = solv->rules + j;
if (r->p >= 0)
int j;
Id p;
Rule *r;
- for (j = solv->rpmrules_end - 1; j > 0; j--)
+ for (j = solv->pkgrules_end - 1; j > 0; j--)
{
r = solv->rules + j;
if (r->d < 0 && r->p)
Repo *installed = solv->installed;
int i;
int oldnrules, initialnrules;
- Map addedmap; /* '1' == have rpm-rules for solvable */
+ Map addedmap; /* '1' == have pkg-rules for solvable */
Map installcandidatemap;
Id how, what, select, name, weak, p, pp, d;
Queue q;
now = solv_timems(0);
/*
* create rules for all package that could be involved with the solving
- * so called: rpm rules
+ * so called: pkg rules
*
*/
- initialnrules = solv->rpmrules_end ? solv->rpmrules_end : 1;
+ initialnrules = solv->pkgrules_end ? solv->pkgrules_end : 1;
if (initialnrules > 1)
deduceq2addedmap(solv, &addedmap);
if (solv->nrules != initialnrules)
solver_shrinkrules(solv, initialnrules);
solv->nrules = initialnrules;
- solv->rpmrules_end = 0;
+ solv->pkgrules_end = 0;
if (installed)
{
oldnrules = solv->nrules;
FOR_REPO_SOLVABLES(installed, p, s)
- solver_addrpmrulesforsolvable(solv, s, &addedmap);
- POOL_DEBUG(SOLV_DEBUG_STATS, "added %d rpm rules for installed solvables\n", solv->nrules - oldnrules);
+ solver_addpkgrulesforsolvable(solv, s, &addedmap);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "added %d pkg rules for installed solvables\n", solv->nrules - oldnrules);
oldnrules = solv->nrules;
FOR_REPO_SOLVABLES(installed, p, s)
- solver_addrpmrulesforupdaters(solv, s, &addedmap, 1);
- POOL_DEBUG(SOLV_DEBUG_STATS, "added %d rpm rules for updaters of installed solvables\n", solv->nrules - oldnrules);
+ solver_addpkgrulesforupdaters(solv, s, &addedmap, 1);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "added %d pkg rules for updaters of installed solvables\n", solv->nrules - oldnrules);
}
/*
FOR_JOB_SELECT(p, pp, select, what)
{
MAPSET(&installcandidatemap, p);
- solver_addrpmrulesforsolvable(solv, pool->solvables + p, &addedmap);
+ solver_addpkgrulesforsolvable(solv, pool->solvables + p, &addedmap);
}
break;
case SOLVER_DISTUPGRADE:
break;
}
}
- POOL_DEBUG(SOLV_DEBUG_STATS, "added %d rpm rules for packages involved in a job\n", solv->nrules - oldnrules);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "added %d pkg rules for packages involved in a job\n", solv->nrules - oldnrules);
/*
* add rules for suggests, enhances
*/
oldnrules = solv->nrules;
- solver_addrpmrulesforweak(solv, &addedmap);
- POOL_DEBUG(SOLV_DEBUG_STATS, "added %d rpm rules because of weak dependencies\n", solv->nrules - oldnrules);
+ solver_addpkgrulesforweak(solv, &addedmap);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "added %d pkg rules because of weak dependencies\n", solv->nrules - oldnrules);
#ifdef ENABLE_LINKED_PKGS
oldnrules = solv->nrules;
- solver_addrpmrulesforlinked(solv, &addedmap);
- POOL_DEBUG(SOLV_DEBUG_STATS, "added %d rpm rules because of linked packages\n", solv->nrules - oldnrules);
+ solver_addpkgrulesforlinked(solv, &addedmap);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "added %d pkg rules because of linked packages\n", solv->nrules - oldnrules);
#endif
/*
- * first pass done, we now have all the rpm rules we need.
+ * first pass done, we now have all the pkg rules we need.
* unify existing rules before going over all job rules and
* policy rules.
* at this point the system is always solvable,
}
if (solv->nrules > initialnrules)
- solver_unifyrules(solv); /* remove duplicate rpm rules */
- solv->rpmrules_end = solv->nrules; /* mark end of rpm rules */
+ solver_unifyrules(solv); /* remove duplicate pkg rules */
+ solv->pkgrules_end = solv->nrules; /* mark end of pkg rules */
if (solv->nrules > initialnrules)
addedmap2deduceq(solv, &addedmap); /* so that we can recreate the addedmap */
- POOL_DEBUG(SOLV_DEBUG_STATS, "rpm rule memory used: %d K\n", solv->nrules * (int)sizeof(Rule) / 1024);
- POOL_DEBUG(SOLV_DEBUG_STATS, "rpm rule creation took %d ms\n", solv_timems(now));
+ POOL_DEBUG(SOLV_DEBUG_STATS, "pkg rule memory used: %d K\n", solv->nrules * (int)sizeof(Rule) / 1024);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "pkg rule creation took %d ms\n", solv_timems(now));
/* create dup maps if needed. We need the maps early to create our
* update rules */
map_free(&installcandidatemap);
queue_free(&q);
- POOL_DEBUG(SOLV_DEBUG_STATS, "%d rpm rules, 2 * %d update rules, %d job rules, %d infarch rules, %d dup rules, %d choice rules, %d best rules\n", solv->rpmrules_end - 1, solv->updaterules_end - solv->updaterules, solv->jobrules_end - solv->jobrules, solv->infarchrules_end - solv->infarchrules, solv->duprules_end - solv->duprules, solv->choicerules_end - solv->choicerules, solv->bestrules_end - solv->bestrules);
+ POOL_DEBUG(SOLV_DEBUG_STATS, "%d pkg rules, 2 * %d update rules, %d job rules, %d infarch rules, %d dup rules, %d choice rules, %d best rules\n", solv->pkgrules_end - 1, solv->updaterules_end - solv->updaterules, solv->jobrules_end - solv->jobrules, solv->infarchrules_end - solv->infarchrules, solv->duprules_end - solv->duprules, solv->choicerules_end - solv->choicerules, solv->bestrules_end - solv->bestrules);
POOL_DEBUG(SOLV_DEBUG_STATS, "overall rule memory used: %d K\n", solv->nrules * (int)sizeof(Rule) / 1024);
/* create weak map */
Repo *installed; /* copy of pool->installed */
/* list of rules, ordered
- * rpm rules first, then features, updates, jobs, learnt
+ * pkg rules first, then features, updates, jobs, learnt
* see start/end offsets below
*/
Rule *rules; /* all rules */
/* start/end offset for rule 'areas' */
- Id rpmrules_end; /* [Offset] rpm rules end */
+ Id pkgrules_end; /* [Offset] dep rules end */
Id featurerules; /* feature rules start/end */
Id featurerules_end;
Queue *installsuppdepq; /* deps from the install namespace provides hack */
- Queue addedmap_deduceq; /* deduce addedmap from rpm rules */
+ Queue addedmap_deduceq; /* deduce addedmap from pkg rules */
Id *instbuddy; /* buddies of installed packages */
int keep_orphans; /* how to treat orphans */
int break_orphans; /* how to treat orphans */