This file contains the major changes between
libsolv versions:
+Version 0.7.9
+- new features:
+ * support conda constrains dependencies
+
Version 0.7.8
- selected bug fixes:
* support arch<->noarch package changes when creating patch
SET(LIBSOLV_MAJOR "0")
SET(LIBSOLV_MINOR "7")
-SET(LIBSOLV_PATCH "8")
+SET(LIBSOLV_PATCH "9")
}
static int
+parse_otherdeps(struct parsedata *pd, struct solv_jsonparser *jp, Id handle, Id keyname)
+{
+ int type = JP_ARRAY;
+ while (type > 0 && (type = jsonparser_parse(jp)) > 0 && type != JP_ARRAY_END)
+ {
+ if (type == JP_STRING)
+ {
+ Id id = pool_conda_matchspec(pd->pool, jp->value);
+ if (id)
+ repodata_add_idarray(pd->data, handle, keyname, id);
+ }
+ else
+ type = jsonparser_skip(jp, type);
+ }
+ return type;
+}
+
+static int
parse_package(struct parsedata *pd, struct solv_jsonparser *jp, char *kfn)
{
int type = JP_OBJECT;
type = parse_deps(pd, jp, &s->requires);
else if (type == JP_ARRAY && !strcmp(jp->key, "requires"))
type = parse_deps(pd, jp, &s->requires);
+ else if (type == JP_ARRAY && !strcmp(jp->key, "constrains"))
+ type = parse_otherdeps(pd, jp, handle, SOLVABLE_CONSTRAINS);
else if (type == JP_STRING && !strcmp(jp->key, "license"))
repodata_add_poolstr_array(data, handle, SOLVABLE_LICENSE, jp->value);
else if (type == JP_STRING && !strcmp(jp->key, "md5"))
fprintf(fp, "%s\n", testcase_dep2str(pool, q.elements[i]));
fprintf(fp, "-Ipr:\n");
}
+ if (solvable_lookup_idarray(s, SOLVABLE_CONSTRAINS, &q))
+ {
+ int i;
+ fprintf(fp, "+Cns:\n");
+ for (i = 0; i < q.count; i++)
+ fprintf(fp, "%s\n", testcase_dep2str(pool, q.elements[i]));
+ fprintf(fp, "-Cns:\n");
+ }
if (s->vendor)
fprintf(fp, "=Vnd: %s\n", pool_id2str(pool, s->vendor));
if (solvable_lookup_idarray(s, SOLVABLE_BUILDFLAVOR, &q))
repodata_add_idarray(data, s - pool->solvables, SOLVABLE_PREREQ_IGNOREINST, id);
break;
}
+ case 'C' << 16 | 'n' << 8 | 's':
+ repodata_add_idarray(data, s - pool->solvables, SOLVABLE_CONSTRAINS, testcase_str2dep(pool, line + 6));
+ break;
case 'F' << 16 | 'l' << 8 | 'v':
repodata_add_poolstr_array(data, s - pool->solvables, SOLVABLE_BUILDFLAVOR, line + 6);
break;
-------------------------------------------------------------------
+Thu Nov 21 16:34:52 CET 2019 - mls@suse.de
+
+- support conda constrains dependencies
+- bump version to 0.7.9
+
+-------------------------------------------------------------------
Tue Nov 12 11:35:12 CET 2019 - mls@suse.de
- support arch<->noarch package changes when creating patch
KNOWNID(LIBSOLV_SELF_DESTRUCT_PKG, "libsolv-self-destruct-pkg()"), /* this package will self-destruct on installation */
+KNOWNID(SOLVABLE_CONSTRAINS, "solvable:constrains"), /* conda */
+
KNOWNID(ID_NUM_INTERNAL, 0)
#ifdef KNOWNID_INITIALIZE
int ncycles;
};
-static int
+static void
addteedge(struct orderdata *od, int from, int to, int type)
{
int i;
struct s_TransactionElement *te;
if (from == to)
- return 0;
+ return;
/* printf("edge %d(%s) -> %d(%s) type %x\n", from, pool_solvid2str(pool, od->tes[from].p), to, pool_solvid2str(pool, od->tes[to].p), type); */
for (i = te->edges; od->edgedata[i]; i += 2)
if (od->edgedata[i] == to)
break;
- /* test of brokenness */
- if (type == TYPE_BROKEN)
- return od->edgedata[i] && (od->edgedata[i + 1] & TYPE_BROKEN) != 0 ? 1 : 0;
if (od->edgedata[i])
{
od->edgedata[i + 1] |= type;
- return 0;
+ return;
}
if (i + 1 == od->nedgedata)
{
od->edgedata[i + 1] = type;
od->edgedata[i + 2] = 0; /* end marker */
od->nedgedata = i + 3;
- return 0;
}
-static int
+static void
addedge(struct orderdata *od, Id from, Id to, int type)
{
Transaction *trans = od->trans;
from = trans->transaction_installed[from - pool->installed->start];
else
{
- int ret = 0;
Queue ti;
Id tibuf[5];
queue_init_buffer(&ti, tibuf, sizeof(tibuf)/sizeof(*tibuf));
transaction_all_obs_pkgs(trans, from, &ti);
for (i = 0; i < ti.count; i++)
- ret |= addedge(od, ti.elements[i], to, type);
+ addedge(od, ti.elements[i], to, type);
queue_free(&ti);
- return ret;
+ return;
}
}
s = pool->solvables + to;
to = trans->transaction_installed[to - pool->installed->start];
else
{
- int ret = 0;
Queue ti;
Id tibuf[5];
queue_init_buffer(&ti, tibuf, sizeof(tibuf)/sizeof(*tibuf));
transaction_all_obs_pkgs(trans, to, &ti);
for (i = 0; i < ti.count; i++)
- ret |= addedge(od, from, ti.elements[i], type);
+ addedge(od, from, ti.elements[i], type);
queue_free(&ti);
- return ret;
+ return;
}
}
if (te->p == to)
break;
if (i == od->ntes)
- return 0;
+ return;
to = i;
for (i = 1, te = od->tes + i; i < od->ntes; i++, te++)
if (te->p == from)
break;
if (i == od->ntes)
- return 0;
+ return;
+ from = i;
- return addteedge(od, i, to, type);
+ addteedge(od, from, to, type);
}
static inline int
return pool_tmpappend(pool, s, pool_dep2str(pool, dep), 0);
case SOLVER_RULE_BLACK:
return pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), " can only be installed by a direct request");
+ case SOLVER_RULE_PKG_CONSTRAINS:
+ s = pool_tmpjoin(pool, "package ", pool_solvid2str(pool, source), 0);
+ s = pool_tmpappend(pool, s, " has constraint ", pool_dep2str(pool, dep));
+ return pool_tmpappend(pool, s, " conflicting with ", pool_solvid2str(pool, target));
default:
return "bad problem rule type";
}
#endif
+#ifdef ENABLE_CONDA
+void
+add_conda_constrains_rule(Solver *solv, Id n, Id dep, int dontfix)
+{
+ Pool *pool = solv->pool;
+ Reldep *rd;
+ Id p, pp, pdep;
+ if (!ISRELDEP(dep))
+ return;
+ rd = GETRELDEP(pool, dep);
+ pdep = pool_whatprovides(pool, dep);
+ FOR_PROVIDES(p, pp, rd->name)
+ {
+ Id p2;
+ if (p == n)
+ continue;
+ if (dontfix && pool->solvables[p].repo == solv->installed)
+ continue;
+ while ((p2 = pool->whatprovidesdata[pdep]) != 0 && p2 < p)
+ pdep++;
+ if (p == p2)
+ pdep++;
+ else
+ addpkgrule(solv, -n, -p, 0, SOLVER_RULE_PKG_CONSTRAINS, dep);
+ }
+}
+#endif
+
/*-------------------------------------------------------------------
*
* add dependency rules for solvable
Queue workq; /* list of solvables we still have to work on */
Id workqbuf[64];
- Queue prereqq; /* list of pre-req ids to ignore */
- Id prereqbuf[16];
+ Queue depq; /* list of pre-req ids to ignore */
+ Id depqbuf[16];
int i;
int dontfix; /* ignore dependency errors for installed solvables */
queue_init_buffer(&workq, workqbuf, sizeof(workqbuf)/sizeof(*workqbuf));
queue_push(&workq, s - pool->solvables); /* push solvable Id to work queue */
- queue_init_buffer(&prereqq, prereqbuf, sizeof(prereqbuf)/sizeof(*prereqbuf));
+ queue_init_buffer(&depq, depqbuf, sizeof(depqbuf)/sizeof(*depqbuf));
/* loop until there's no more work left */
while (workq.count)
{
if (installed && s->repo == installed)
{
- if (prereqq.count)
- queue_empty(&prereqq);
- solvable_lookup_idarray(s, SOLVABLE_PREREQ_IGNOREINST, &prereqq);
- filterpre = prereqq.count;
+ solvable_lookup_idarray(s, SOLVABLE_PREREQ_IGNOREINST, &depq);
+ filterpre = depq.count;
}
continue;
}
if (filterpre)
{
- /* check if this id is filtered. assumes that prereqq.count is small */
- for (i = 0; i < prereqq.count; i++)
- if (req == prereqq.elements[i])
+ /* check if this id is filtered. assumes that depq.count is small */
+ for (i = 0; i < depq.count; i++)
+ if (req == depq.elements[i])
break;
- if (i < prereqq.count)
+ if (i < depq.count)
{
POOL_DEBUG(SOLV_DEBUG_RULE_CREATION, "package %s: ignoring filtered pre-req dependency %s\n", pool_solvable2str(pool, s), pool_dep2str(pool, req));
continue;
}
}
+#ifdef ENABLE_CONDA
+ if (pool->disttype == DISTTYPE_CONDA)
+ {
+ solvable_lookup_idarray(s, SOLVABLE_CONSTRAINS, &depq);
+ for (i = 0; i < depq.count; i++)
+ add_conda_constrains_rule(solv, n, depq.elements[i], dontfix);
+ }
+#endif
+
/* that's all we check for src packages */
if (s->arch == ARCH_SRC || s->arch == ARCH_NOSRC)
continue;
}
}
}
- queue_free(&prereqq);
+ queue_free(&depq);
queue_free(&workq);
}
SOLVER_RULE_PKG_IMPLICIT_OBSOLETES,
SOLVER_RULE_PKG_INSTALLED_OBSOLETES,
SOLVER_RULE_PKG_RECOMMENDS,
+ SOLVER_RULE_PKG_CONSTRAINS,
SOLVER_RULE_UPDATE = 0x200,
SOLVER_RULE_FEATURE = 0x300,
SOLVER_RULE_JOB = 0x400,