commit libsolv for openSUSE:Factory
Hello community, here is the log from the commit of package libsolv for openSUSE:Factory checked in at 2015-04-02 16:02:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libsolv (Old) and /work/SRC/openSUSE:Factory/.libsolv.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "libsolv" Changes: -------- --- /work/SRC/openSUSE:Factory/libsolv/libsolv.changes 2015-03-16 06:57:55.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libsolv.new/libsolv.changes 2015-04-02 16:02:02.000000000 +0200 @@ -1,0 +2,7 @@ +Wed Mar 18 11:04:34 CET 2015 - mls@suse.de + +- fix bug in dislike_old_versions that could lead to a segfault + [bnc#922352] +- bump version to 0.6.10 + +------------------------------------------------------------------- Old: ---- libsolv-0.6.9.tar.bz2 New: ---- libsolv-0.6.10.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libsolv.spec ++++++ --- /var/tmp/diff_new_pack.aKIwya/_old 2015-04-02 16:02:02.000000000 +0200 +++ /var/tmp/diff_new_pack.aKIwya/_new 2015-04-02 16:02:02.000000000 +0200 @@ -17,7 +17,7 @@ Name: libsolv -Version: 0.6.9 +Version: 0.6.10 Release: 0 Url: https://github.com/openSUSE/libsolv Source: libsolv-%{version}.tar.bz2 ++++++ libsolv-0.6.9.tar.bz2 -> libsolv-0.6.10.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/VERSION.cmake new/libsolv-0.6.10/VERSION.cmake --- old/libsolv-0.6.9/VERSION.cmake 2015-03-09 16:50:37.000000000 +0100 +++ new/libsolv-0.6.10/VERSION.cmake 2015-03-18 11:11:12.000000000 +0100 @@ -49,5 +49,5 @@ SET(LIBSOLV_MAJOR "0") SET(LIBSOLV_MINOR "6") -SET(LIBSOLV_PATCH "9") +SET(LIBSOLV_PATCH "10") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/doc/libsolv-constantids.3 new/libsolv-0.6.10/doc/libsolv-constantids.3 --- old/libsolv-0.6.9/doc/libsolv-constantids.3 2014-09-22 17:46:10.000000000 +0200 +++ new/libsolv-0.6.10/doc/libsolv-constantids.3 2015-03-19 13:26:11.000000000 +0100 @@ -2,12 +2,12 @@ .\" Title: Libsolv-Constantids .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets v1.78.0 <http://docbook.sf.net/> -.\" Date: 01/21/2014 +.\" Date: 03/19/2015 .\" Manual: LIBSOLV .\" Source: libsolv .\" Language: English .\" -.TH "LIBSOLV\-CONSTANTIDS" "3" "01/21/2014" "libsolv" "LIBSOLV" +.TH "LIBSOLV\-CONSTANTIDS" "3" "03/19/2015" "libsolv" "LIBSOLV" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -89,7 +89,7 @@ .PP \fBSOLVABLE_RECOMMENDS "solvable:recommends"\fR .RS 4 -Stores an array of dependency Ids that describe the capabilities that also should be installed when this package is installed\&. It\(cqs not an error if not all capabilities can be met\&. +Stores an array of dependency Ids that describe the capabilities that also should be installed when this package is installed\&. It\(cqs not an error if not all capabilites can be met\&. .RE .PP \fBSOLVABLE_SUGGESTS "solvable:suggests"\fR @@ -541,11 +541,6 @@ .sp The dependency markers partition the dependency array in two parts with different semantics\&. .PP -\fBNAMESPACE_INSTALLED "namespace:installed"\fR -.RS 4 -The dependency only selects installed packages\&. -.RE -.PP \fBNAMESPACE_MODALIAS "namespace:modalias"\fR .RS 4 The dependency is a special modalias dependency that matches installed hardware\&. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/doc/libsolv-constantids.txt new/libsolv-0.6.10/doc/libsolv-constantids.txt --- old/libsolv-0.6.9/doc/libsolv-constantids.txt 2014-07-01 11:09:49.000000000 +0200 +++ new/libsolv-0.6.10/doc/libsolv-constantids.txt 2015-03-19 13:26:11.000000000 +0100 @@ -400,9 +400,6 @@ The dependency markers partition the dependency array in two parts with different semantics. -*NAMESPACE_INSTALLED "namespace:installed"*:: - The dependency only selects installed packages. - *NAMESPACE_MODALIAS "namespace:modalias"*:: The dependency is a special modalias dependency that matches installed hardware. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/ext/repo_deb.c new/libsolv-0.6.10/ext/repo_deb.c --- old/libsolv-0.6.9/ext/repo_deb.c 2015-02-25 12:06:00.000000000 +0100 +++ new/libsolv-0.6.10/ext/repo_deb.c 2015-03-23 12:51:10.000000000 +0100 @@ -655,7 +655,9 @@ l = 0; if (name && autoinstalled > 0) { - if ((flags & GET_USERINSTALLED_NAMES) != 0) + if ((flags & GET_USERINSTALLED_NAMEARCH) != 0) + queue_push2(q, name, arch); + else if ((flags & GET_USERINSTALLED_NAMES) != 0) queue_push(q, name); else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/ext/testcase.c new/libsolv-0.6.10/ext/testcase.c --- old/libsolv-0.6.9/ext/testcase.c 2015-03-03 14:55:38.000000000 +0100 +++ new/libsolv-0.6.10/ext/testcase.c 2015-03-23 15:16:12.000000000 +0100 @@ -78,6 +78,8 @@ { TESTCASE_RESULT_RECOMMENDED, "recommended" }, { TESTCASE_RESULT_UNNEEDED, "unneeded" }, { TESTCASE_RESULT_ALTERNATIVES, "alternatives" }, + { TESTCASE_RESULT_RULES, "rules" }, + { TESTCASE_RESULT_GENID, "genid" }, { 0, 0 } }; @@ -158,6 +160,15 @@ { 0, 0 } }; +static const char *features[] = { +#ifdef ENABLE_LINKED_PACKAGES + "linked_packages", +#endif +#ifdef ENABLE_COMPLEX_DEPS + "complex_deps", +#endif + 0 +}; typedef struct strqueue { char **str; @@ -322,13 +333,13 @@ /* we need escaping! */ s2 = s2p = pool_alloctmpspace(pool, strlen(s) + bad * 2 + 1); - ss = s; if (!strncmp(s, "namespace:", 10)) { strcpy(s2p, "namespace\\3a"); s2p += 12; s += 10; } + ss = s; for (; *ss; ss++) { *s2p++ = *ss; @@ -1668,6 +1679,33 @@ { 0, 0 } }; +static int +dump_genid(Pool *pool, Strqueue *sq, Id id, int cnt) +{ + struct oplist *op; + char cntbuf[20]; + const char *s; + + if (ISRELDEP(id)) + { + Reldep *rd = GETRELDEP(pool, id); + for (op = oplist; op->flags; op++) + if (rd->flags == op->flags) + break; + cnt = dump_genid(pool, sq, rd->name, cnt); + cnt = dump_genid(pool, sq, rd->evr, cnt); + sprintf(cntbuf, "genid %2d: genid ", cnt++); + s = pool_tmpjoin(pool, cntbuf, "op ", op->flags ? op->opname : "unknown"); + } + else + { + sprintf(cntbuf, "genid %2d: genid ", cnt++); + s = pool_tmpjoin(pool, cntbuf, id ? "lit " : "null", id ? pool_id2str(pool, id) : 0); + } + strqueue_push(sq, s); + return cnt; +} + char * testcase_solverresult(Solver *solv, int resultflags) { @@ -1874,7 +1912,90 @@ queue_free(&q); queue_free(&rq); } + if ((resultflags & TESTCASE_RESULT_RULES) != 0) + { + /* dump all rules */ + Id rid; + SolverRuleinfo rclass; + Queue q; + int i; + queue_init(&q); + for (rid = 1; (rclass = solver_ruleclass(solv, rid)) != SOLVER_RULE_UNKNOWN; rid++) + { + char *prefix; + switch (rclass) + { + case SOLVER_RULE_PKG: + prefix = "pkg "; + break; + case SOLVER_RULE_UPDATE: + prefix = "update "; + break; + case SOLVER_RULE_FEATURE: + prefix = "feature "; + break; + case SOLVER_RULE_JOB: + prefix = "job "; + break; + case SOLVER_RULE_DISTUPGRADE: + prefix = "distupgrade "; + break; + case SOLVER_RULE_INFARCH: + prefix = "infarch "; + break; + case SOLVER_RULE_CHOICE: + prefix = "choice "; + break; + case SOLVER_RULE_LEARNT: + prefix = "learnt "; + break; + case SOLVER_RULE_BEST: + prefix = "best "; + break; + case SOLVER_RULE_YUMOBS: + prefix = "yumobs "; + break; + default: + prefix = "unknown "; + break; + } + prefix = solv_dupjoin("rule ", prefix, testcase_ruleid(solv, rid)); + solver_ruleliterals(solv, rid, &q); + if (rclass == SOLVER_RULE_FEATURE && q.count == 1 && q.elements[0] == -SYSTEMSOLVABLE) + continue; + for (i = 0; i < q.count; i++) + { + Id p = q.elements[i]; + const char *s; + if (p < 0) + s = pool_tmpjoin(pool, prefix, " -", testcase_solvid2str(pool, -p)); + else + s = pool_tmpjoin(pool, prefix, " ", testcase_solvid2str(pool, p)); + strqueue_push(&sq, s); + } + solv_free(prefix); + } + queue_free(&q); + } + if ((resultflags & TESTCASE_RESULT_GENID) != 0) + { + for (i = 0 ; i < solv->job.count; i += 2) + { + Id id, id2; + if (solv->job.elements[i] != (SOLVER_NOOP | SOLVER_SOLVABLE_PROVIDES)) + continue; + id = solv->job.elements[i + 1]; + s = testcase_dep2str(pool, id); + strqueue_push(&sq, pool_tmpjoin(pool, "genid dep ", s, 0)); + if ((id2 = testcase_str2dep(pool, s)) != id) + { + s = pool_tmpjoin(pool, "genid roundtrip error: ", testcase_dep2str(pool, id2), 0); + strqueue_push(&sq, s); + } + dump_genid(pool, &sq, id, 1); + } + } strqueue_sort(&sq); result = strqueue_join(&sq); strqueue_free(&sq); @@ -2221,6 +2342,9 @@ int prepared = 0; int closefp = !fp; int poolflagsreset = 0; + int missing_features = 0; + Id *genid = 0; + int ngenid = 0; if (!fp && !(fp = fopen(testcase, "r"))) { @@ -2511,11 +2635,75 @@ else pool_debug(pool, SOLV_ERROR, "disable: unknown package '%s'\n", pieces[2]); } + else if (!strcmp(pieces[0], "feature")) + { + int i, j; + for (i = 1; i < npieces; i++) + { + for (j = 0; features[j]; j++) + if (!strcmp(pieces[i], features[j])) + break; + if (!features[j]) + { + pool_debug(pool, SOLV_ERROR, "testcase_read: missing feature '%s'\n", pieces[i]); + missing_features++; + } + } + if (missing_features) + break; + } + else if (!strcmp(pieces[0], "genid") && npieces > 1) + { + Id id; + /* rejoin */ + if (npieces > 2) + { + char *sp; + for (sp = pieces[2]; sp < pieces[npieces - 1]; sp++) + if (*sp == 0) + *sp = ' '; + } + genid = solv_extend(genid, ngenid, 1, sizeof(*genid), 7); + if (!strcmp(pieces[1], "op") && npieces > 2) + { + struct oplist *op; + for (op = oplist; op->flags; op++) + if (!strncmp(pieces[2], op->opname, strlen(op->opname))) + break; + if (!op->flags) + { + pool_debug(pool, SOLV_ERROR, "testcase_read: genid: unknown op '%s'\n", pieces[2]); + break; + } + if (ngenid < 2) + { + pool_debug(pool, SOLV_ERROR, "testcase_read: genid: out of stack\n"); + break; + } + ngenid -= 2; + id = pool_rel2id(pool, genid[ngenid] , genid[ngenid + 1], op->flags, 1); + } + else if (!strcmp(pieces[1], "lit")) + id = pool_str2id(pool, npieces > 2 ? pieces[2] : "", 1); + else if (!strcmp(pieces[1], "null")) + id = 0; + else if (!strcmp(pieces[1], "dep")) + id = testcase_str2dep(pool, pieces[2]); + else + { + pool_debug(pool, SOLV_ERROR, "testcase_read: genid: unknown command '%s'\n", pieces[1]); + break; + } + genid[ngenid++] = id; + } else { pool_debug(pool, SOLV_ERROR, "testcase_read: cannot parse command '%s'\n", pieces[0]); } } + while (job && ngenid > 0) + queue_push2(job, SOLVER_NOOP | SOLVER_SOLVABLE_PROVIDES, genid[--ngenid]); + genid = solv_free(genid); buf = solv_free(buf); pieces = solv_free(pieces); solv_free(testcasedir); @@ -2531,6 +2719,13 @@ } if (closefp) fclose(fp); + if (missing_features) + { + solver_free(solv); + solv = 0; + if (resultflagsp) + *resultflagsp = 77; /* hack for testsolv */ + } return solv; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/ext/testcase.h new/libsolv-0.6.10/ext/testcase.h --- old/libsolv-0.6.9/ext/testcase.h 2015-03-03 14:55:38.000000000 +0100 +++ new/libsolv-0.6.10/ext/testcase.h 2015-03-23 12:51:10.000000000 +0100 @@ -15,6 +15,8 @@ #define TESTCASE_RESULT_RECOMMENDED (1 << 3) #define TESTCASE_RESULT_UNNEEDED (1 << 4) #define TESTCASE_RESULT_ALTERNATIVES (1 << 5) +#define TESTCASE_RESULT_RULES (1 << 6) +#define TESTCASE_RESULT_GENID (1 << 7) extern Id testcase_str2dep(Pool *pool, const char *s); extern const char *testcase_dep2str(Pool *pool, Id id); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/package/libsolv.changes new/libsolv-0.6.10/package/libsolv.changes --- old/libsolv-0.6.9/package/libsolv.changes 2015-03-09 16:50:37.000000000 +0100 +++ new/libsolv-0.6.10/package/libsolv.changes 2015-03-18 11:11:12.000000000 +0100 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Mar 18 11:04:34 CET 2015 - mls@suse.de + +- fix bug in dislike_old_versions that could lead to a segfault + [bnc#922352] +- bump version to 0.6.10 + +------------------------------------------------------------------- Mon Mar 9 16:42:35 CET 2015 - mls@suse.de - rework splitprovides handling [bnc#921332] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/src/cplxdeps.c new/libsolv-0.6.10/src/cplxdeps.c --- old/libsolv-0.6.9/src/cplxdeps.c 2014-07-01 11:09:49.000000000 +0200 +++ new/libsolv-0.6.10/src/cplxdeps.c 2015-03-19 16:46:11.000000000 +0100 @@ -68,6 +68,33 @@ return newsplit; } +#ifdef CPLXDEBUG +static void +print_depblocks(Pool *pool, Queue *bq, int start) +{ + int i; + + for (i = start; i < bq->count; i++) + { + if (bq->elements[i] == pool->nsolvables) + { + Id *dp = pool->whatprovidesdata + bq->elements[++i]; + printf(" ("); + while (*dp) + printf(" %s", pool_solvid2str(pool, *dp++)); + printf(" )"); + } + else if (bq->elements[i] > 0) + printf(" %s", pool_solvid2str(pool, bq->elements[i])); + else if (bq->elements[i] < 0) + printf(" -%s", pool_solvid2str(pool, -bq->elements[i])); + else + printf(" ||"); + } + printf("\n"); +} +#endif + /* invert all literals in the blocks. note that this also turns DNF into CNF and vice versa */ static void invert_depblocks(Pool *pool, Queue *bq, int start) @@ -82,7 +109,7 @@ bq->elements[i] = -bq->elements[i]; continue; } - /* end of block reached, reorder */ + /* end of block reached, reverse */ if (i - 1 > j) { int k; @@ -151,7 +178,7 @@ /* get blocks of second argument */ bqcnt2 = bq->count; - /* COND is OR with NEG on evr block, so we invert the todnf flag in that case*/ + /* COND is OR with NEG on evr block, so we invert the todnf flag in that case */ r = normalize_dep(pool, rd->evr, bq, flags == REL_COND ? todnf ^ 1 : todnf); if (r == 0) { @@ -284,27 +311,7 @@ else if (i == 1) printf("ALL\n"); else - { - for (i = bqcnt; i < bq->count; i++) - { - if (bq->elements[i] == pool->nsolvables) - { - Id *dp = pool->whatprovidesdata + bq->elements[++i]; - printf(" ("); - while (*dp) - printf(" %s", pool_solvid2str(pool, *dp++)); - printf(" )"); - } - else if (bq->elements[i] > 0) - printf(" %s", pool_solvid2str(pool, bq->elements[i])); - else if (bq->elements[i] < 0) - printf(" -%s", pool_solvid2str(pool, -bq->elements[i])); - else - printf(" ||"); - } - printf("\n"); - i = -1; - } + print_depblocks(pool, bq, bqcnt); #endif return i; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/src/policy.c new/libsolv-0.6.10/src/policy.c --- old/libsolv-0.6.9/src/policy.c 2015-02-24 19:01:02.000000000 +0100 +++ new/libsolv-0.6.10/src/policy.c 2015-03-21 18:56:11.000000000 +0100 @@ -220,6 +220,11 @@ #ifdef ENABLE_COMPLEX_DEPS +/* simple fixed-size hash for package ids */ +#define CPLXDEPHASH_EMPTY(elements) (memset(elements, 0, sizeof(Id) * 256)) +#define CPLXDEPHASH_SET(elements, p) (elements[(p) & 255] |= (1 << ((p) >> 8 & 31))) +#define CPLXDEPHASH_TST(elements, p) (elements[(p) & 255] && (elements[(p) & 255] & (1 << ((p) >> 8 & 31)))) + static void check_complex_dep(Solver *solv, Id dep, Map *m, Queue **cqp) { @@ -241,55 +246,64 @@ qcnt = q.count; for (i = 0; i < qcnt; i++) { - for (; (p = q.elements[i]) != 0; i++) + /* we rely on the fact that blocks are ordered here. + * if we reach a positive element, we know that we + * saw all negative ones */ + for (; (p = q.elements[i]) < 0; i++) { - if (p < 0) - { - if (solv->decisionmap[-p] > 0) - continue; - if (solv->decisionmap[-p] < 0) - break; - queue_push(&q, -p); - } - if (p > 0 && qcnt == q.count) - MAPSET(m, p); + if (solv->decisionmap[-p] < 0) + break; + if (solv->decisionmap[-p] == 0) + queue_push(&q, -p); /* undecided negative literal */ } - if (q.elements[i]) + if (p <= 0) { #if 0 - printf("complex dep block cannot be true\n"); + printf("complex dep block cannot be true or no pos literals\n"); #endif while (q.elements[i]) i++; if (qcnt != q.count) queue_truncate(&q, qcnt); + continue; } - else if (qcnt != q.count) + if (qcnt == q.count) { + /* all negative literals installed, add positive literals to map */ + for (; (p = q.elements[i]) != 0; i++) + MAPSET(m, p); + } + else + { + /* at least one undecided negative literal, postpone */ int j, k; - Queue *cq = *cqp; + Queue *cq; #if 0 printf("add new complex dep block\n"); for (j = qcnt; j < q.count; j++) printf(" - %s\n", pool_solvid2str(pool, q.elements[j])); #endif - if (!cq) + while (q.elements[i]) + i++; + if (!(cq = *cqp)) { cq = solv_calloc(1, sizeof(Queue)); queue_init(cq); + queue_insertn(cq, 0, 256, 0); /* allocate hash area */ *cqp = cq; - queue_insertn(cq, 0, 256, 0); } for (j = qcnt; j < q.count; j++) { p = q.elements[j]; + /* check if we already have this (dep, p) entry */ for (k = 256; k < cq->count; k += 2) if (cq->elements[k + 1] == dep && cq->elements[k] == p) break; if (k == cq->count) { + /* a new one. add to cq and hash */ queue_push2(cq, p, dep); - cq->elements[p & 255] |= (1 << (p >> 8 & 31)); + CPLXDEPHASH_SET(cq->elements, p); } } queue_truncate(&q, qcnt); @@ -299,13 +313,15 @@ } static void -recheck_complex_dep(Solver *solv, Id p, Map *m, Queue **cqp) +recheck_complex_deps(Solver *solv, Id p, Map *m, Queue **cqp) { Queue *cq = *cqp; + Id pp; int i; #if 0 - printf("recheck_complex_dep for package %s\n", pool_solvid2str(solv->pool, p)); + printf("recheck_complex_deps for package %s\n", pool_solvid2str(solv->pool, p)); #endif + /* make sure that we don't have a false hit */ for (i = 256; i < cq->count; i += 2) if (cq->elements[i] == p) break; @@ -313,9 +329,11 @@ return; /* false alert */ if (solv->decisionmap[p] <= 0) return; /* just in case... */ - memset(cq->elements, 0, sizeof(Id) * 256); + + /* rebuild the hash, call check_complex_dep for our package */ + CPLXDEPHASH_EMPTY(cq->elements); for (i = 256; i < cq->count; i += 2) - if (cq->elements[i] == p) + if ((pp = cq->elements[i]) == p) { Id dep = cq->elements[i + 1]; queue_deleten(cq, i, 2); @@ -323,10 +341,7 @@ check_complex_dep(solv, dep, m, &cq); } else - { - Id pp = cq->elements[i]; - cq->elements[pp & 255] |= (1 << (pp >> 8 & 31)); - } + CPLXDEPHASH_SET(cq->elements, pp); } #endif @@ -364,12 +379,11 @@ continue; s = pool->solvables + p; #ifdef ENABLE_COMPLEX_DEPS - if (solv->recommendscplxq && solv->recommendscplxq->elements[p & 255]) - if (solv->recommendscplxq->elements[p & 255] & (1 << (p >> 8 & 31))) - recheck_complex_dep(solv, p, &solv->recommendsmap, &solv->recommendscplxq); - if (solv->suggestscplxq && solv->suggestscplxq->elements[p & 255]) - if (solv->suggestscplxq->elements[p & 255] & (1 << (p >> 8 & 31))) - recheck_complex_dep(solv, p, &solv->suggestsmap, &solv->suggestscplxq); + /* re-check postponed complex blocks */ + if (solv->recommendscplxq && CPLXDEPHASH_TST(solv->recommendscplxq->elements, p)) + recheck_complex_deps(solv, p, &solv->recommendsmap, &solv->recommendscplxq); + if (solv->suggestscplxq && CPLXDEPHASH_TST(solv->suggestscplxq->elements, p)) + recheck_complex_deps(solv, p, &solv->suggestsmap, &solv->suggestscplxq); #endif if (s->recommends) { @@ -1048,16 +1062,15 @@ static void dislike_old_versions(Pool *pool, Queue *plist) { - int i, count = plist->count; - Id *elements = plist->elements; - int bad = 0; + int i, count; - for (i = 0; i < count; i++) + for (i = 0, count = plist->count; i < count; i++) { - Id p = elements[i]; + Id p = plist->elements[i]; Solvable *s = pool->solvables + p; Repo *repo = s->repo; Id q, qq; + int bad = 0; if (!repo || repo == pool->installed) continue; @@ -1072,30 +1085,22 @@ { if (repo->priority > qs->repo->priority) continue; - elements[i] = -p; bad = 1; break; } if (pool_evrcmp(pool, qs->evr, s->evr, EVRCMP_COMPARE) > 0) { - elements[i] = -p; bad = 1; break; } } - } - if (!bad) - return; - /* now move negative elements to the back */ - for (i = 0; i < count; i++) - { - Id p = elements[i]; - if (p >= 0) + if (!bad) continue; + /* bring to back */ if (i < plist->count - 1) { - memmove(elements + i, elements + i + 1, (plist->count - 1 - i) * sizeof(Id)); - elements[plist->count - 1] = -p; + memmove(plist->elements + i, plist->elements + i + 1, (plist->count - 1 - i) * sizeof(Id)); + plist->elements[plist->count - 1] = p; } i--; count--; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/src/pool.c new/libsolv-0.6.10/src/pool.c --- old/libsolv-0.6.9/src/pool.c 2014-10-09 15:26:09.000000000 +0200 +++ new/libsolv-0.6.10/src/pool.c 2015-03-19 13:26:11.000000000 +0100 @@ -1338,7 +1338,7 @@ dep = rd->name; else if (rd->flags == REL_NAMESPACE) { - if (rd->name == NAMESPACE_INSTALLED || rd->name == NAMESPACE_SPLITPROVIDES) + if (rd->name == NAMESPACE_SPLITPROVIDES) { csf = isf; if (!csf || MAPTST(&csf->seen, sid)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/src/rules.c new/libsolv-0.6.10/src/rules.c --- old/libsolv-0.6.9/src/rules.c 2015-03-09 15:10:38.000000000 +0100 +++ new/libsolv-0.6.10/src/rules.c 2015-03-20 16:36:11.000000000 +0100 @@ -66,8 +66,6 @@ } if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES) return solver_splitprovides(solv, rd->evr, m); - if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED) - return solver_dep_installed(solv, rd->evr); } } FOR_PROVIDES(p, pp, dep) @@ -530,6 +528,17 @@ #ifdef ENABLE_COMPLEX_DEPS +static inline Id +pool_idstowhatprovides(Pool *pool, int count, Id *elements) +{ + /* hack: create fake queue 'q' so that we can call pool_queuetowhatprovides */ + Queue q; + memset(&q, 0, sizeof(q)); + q.count = count; + q.elements = elements; + return pool_queuetowhatprovides(pool, &q); +} + static void add_complex_deprules(Solver *solv, Id p, Id dep, int type, int dontfix, Queue *workq, Map *m) { @@ -669,12 +678,7 @@ break; if (j == qcnt) { - /* hack: create fake queue 'q' so that we can call pool_queuetowhatprovides */ - Queue q; - memset(&q, 0, sizeof(q)); - q.count = qcnt - 1; - q.elements = qele + 1; - addpkgrule(solv, qele[0], pool_queuetowhatprovides(pool, &q), type, dep); + addpkgrule(solv, qele[0], pool_idstowhatprovides(pool, qcnt - 1, qele + 1), type, dep); if (m) for (j = 0; j < qcnt; j++) if (qele[j] > 0 && !MAPTST(m, qele[j])) @@ -2706,7 +2710,7 @@ return SOLVER_RULE_YUMOBS; if (rid >= solv->choicerules && rid < solv->choicerules_end) return SOLVER_RULE_CHOICE; - if (rid >= solv->learntrules) + if (rid >= solv->learntrules && rid < solv->nrules) return SOLVER_RULE_LEARNT; return SOLVER_RULE_UNKNOWN; } @@ -3538,8 +3542,6 @@ } if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES) return; - if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED) - return; } } FOR_PROVIDES(p, pp, dep) @@ -3576,8 +3578,6 @@ #else return 0; #endif - if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED) - return solver_dep_installed(solv, rd->evr); } if (depq && rd->flags == REL_NAMESPACE) { @@ -3783,7 +3783,7 @@ /* have special namespace cleandeps erases */ if (iq.count) { - for (ip = solv->installed->start; ip < solv->installed->end; ip++) + for (ip = installed->start; ip < installed->end; ip++) { s = pool->solvables + ip; if (s->repo != installed) @@ -3792,7 +3792,7 @@ continue; supp = s->repo->idarraydata + s->supplements; while ((sup = *supp++) != 0) - if (check_xsupp(solv, &iq, sup) && !check_xsupp(solv, 0, sup)) + if (ISRELDEP(sup) && check_xsupp(solv, &iq, sup) && !check_xsupp(solv, 0, sup)) { #ifdef CLEANDEPSDEBUG printf("xsupp %s from %s\n", pool_dep2str(pool, sup), pool_solvid2str(pool, ip)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/src/solver.c new/libsolv-0.6.10/src/solver.c --- old/libsolv-0.6.9/src/solver.c 2015-03-09 15:10:38.000000000 +0100 +++ new/libsolv-0.6.10/src/solver.c 2015-03-26 12:46:11.000000000 +0100 @@ -104,93 +104,66 @@ } -/*------------------------------------------------------------------- - * solver_dep_installed - */ - -int -solver_dep_installed(Solver *solv, Id dep) -{ -#if 0 - Pool *pool = solv->pool; - Id p, pp; - - if (ISRELDEP(dep)) - { - Reldep *rd = GETRELDEP(pool, dep); - if (rd->flags == REL_AND) - { - if (!solver_dep_installed(solv, rd->name)) - return 0; - return solver_dep_installed(solv, rd->evr); - } - if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED) - return solver_dep_installed(solv, rd->evr); - } - FOR_PROVIDES(p, pp, dep) - { - if (p == SYSTEMSOLVABLE || (solv->installed && pool->solvables[p].repo == solv->installed)) - return 1; - } -#endif - return 0; -} - -/* mirrors solver_dep_installed, but returns 2 if a - * dependency listed in solv->installsuppdepq was involved */ +/* mirrors solver_dep_fulfilled, but returns 2 if a new package + * was involved */ static int -solver_check_installsuppdepq_dep(Solver *solv, Id dep) +solver_dep_fulfilled_alreadyinstalled(Solver *solv, Id dep) { Pool *pool = solv->pool; Id p, pp; - Queue *q; + int r; if (ISRELDEP(dep)) { Reldep *rd = GETRELDEP(pool, dep); if (rd->flags == REL_AND) { - int r2, r1 = solver_check_installsuppdepq_dep(solv, rd->name); + int r2, r1 = solver_dep_fulfilled_alreadyinstalled(solv, rd->name); if (!r1) return 0; - r2 = solver_check_installsuppdepq_dep(solv, rd->evr); + r2 = solver_dep_fulfilled_alreadyinstalled(solv, rd->evr); if (!r2) return 0; return r1 == 2 || r2 == 2 ? 2 : 1; } if (rd->flags == REL_OR) { - int r2, r1 = solver_check_installsuppdepq_dep(solv, rd->name); - r2 = solver_check_installsuppdepq_dep(solv, rd->evr); + int r2, r1 = solver_dep_fulfilled_alreadyinstalled(solv, rd->name); + r2 = solver_dep_fulfilled_alreadyinstalled(solv, rd->evr); if (!r1 && !r2) return 0; return r1 == 2 || r2 == 2 ? 2 : 1; } if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES) return solver_splitprovides(solv, rd->evr, 0); - if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED) - return solver_dep_installed(solv, rd->evr); - if (rd->flags == REL_NAMESPACE && (q = solv->installsuppdepq) != 0) + if (rd->flags == REL_NAMESPACE && solv->installsuppdepq) { + Queue *q = solv->installsuppdepq; int i; for (i = 0; i < q->count; i++) if (q->elements[i] == dep || q->elements[i] == rd->name) return 2; } } + r = 0; FOR_PROVIDES(p, pp, dep) if (solv->decisionmap[p] > 0) - return 1; - return 0; + { + Solvable *s = pool->solvables + p; + if (s->repo && s->repo != solv->installed) + return 2; + r = 1; + } + return r; } static int -solver_check_installsuppdepq(Solver *solv, Solvable *s) +solver_is_supplementing_alreadyinstalled(Solver *solv, Solvable *s) { Id sup, *supp; supp = s->repo->idarraydata + s->supplements; while ((sup = *supp++) != 0) - if (solver_check_installsuppdepq_dep(solv, sup) == 2) + if (solver_dep_fulfilled_alreadyinstalled(solv, sup) == 2) return 1; return 0; } @@ -2586,39 +2559,15 @@ /* filter out all already supplemented packages if requested */ if (!solv->addalreadyrecommended && dqs.count) { - /* turn off all new packages */ - for (i = 0; i < solv->decisionq.count; i++) - { - p = solv->decisionq.elements[i]; - if (p < 0) - continue; - s = pool->solvables + p; - if (s->repo && s->repo != solv->installed) - solv->decisionmap[p] = -solv->decisionmap[p]; - } /* filter out old supplements */ for (i = j = 0; i < dqs.count; i++) { p = dqs.elements[i]; s = pool->solvables + p; - if (!s->supplements) - continue; - if (!solver_is_supplementing(solv, s)) - dqs.elements[j++] = p; - else if (solv->installsuppdepq && solver_check_installsuppdepq(solv, s)) + if (s->supplements && solver_is_supplementing_alreadyinstalled(solv, s)) dqs.elements[j++] = p; } dqs.count = j; - /* undo turning off */ - for (i = 0; i < solv->decisionq.count; i++) - { - p = solv->decisionq.elements[i]; - if (p < 0) - continue; - s = pool->solvables + p; - if (s->repo && s->repo != solv->installed) - solv->decisionmap[p] = -solv->decisionmap[p]; - } } /* multiversion doesn't mix well with supplements. @@ -4665,21 +4614,69 @@ return strcmp(pool_id2str(pool, *(Id *)ap), pool_id2str(pool, *(Id *)bp)); } +static int +get_userinstalled_cmp_namearch(const void *ap, const void *bp, void *dp) +{ + Pool *pool = dp; + int r; + r = strcmp(pool_id2str(pool, ((Id *)ap)[0]), pool_id2str(pool, ((Id *)bp)[0])); + if (r) + return r; + return strcmp(pool_id2str(pool, ((Id *)ap)[1]), pool_id2str(pool, ((Id *)bp)[1])); +} + static void get_userinstalled_sort_uniq(Pool *pool, Queue *q, int flags) { - Id lastp = -1; + Id lastp = -1, lasta = -1; int i, j; - if ((flags & GET_USERINSTALLED_NAMES) != 0) + if (q->count < ((flags & GET_USERINSTALLED_NAMEARCH) ? 4 : 2)) + return; + if ((flags & GET_USERINSTALLED_NAMEARCH) != 0) + solv_sort(q->elements, q->count / 2, 2 * sizeof(Id), get_userinstalled_cmp_namearch, pool); + else if ((flags & GET_USERINSTALLED_NAMES) != 0) solv_sort(q->elements, q->count, sizeof(Id), get_userinstalled_cmp_names, pool); else solv_sort(q->elements, q->count, sizeof(Id), get_userinstalled_cmp, 0); - for (i = j = 0; i < q->count; i++) - if (q->elements[i] != lastp) - q->elements[j++] = lastp = q->elements[i]; + if ((flags & GET_USERINSTALLED_NAMEARCH) != 0) + { + for (i = j = 0; i < q->count; i += 2) + if (q->elements[i] != lastp || q->elements[i + 1] != lasta) + { + q->elements[j++] = lastp = q->elements[i]; + q->elements[j++] = lasta = q->elements[i + 1]; + } + } + else + { + for (i = j = 0; i < q->count; i++) + if (q->elements[i] != lastp) + q->elements[j++] = lastp = q->elements[i]; + } queue_truncate(q, j); } +static void +namearch2solvables(Pool *pool, Queue *q, Queue *qout, int job) +{ + int i; + if (!pool->installed) + return; + for (i = 0; i < q->count; i += 2) + { + Id p, pp, name = q->elements[i], arch = q->elements[i + 1]; + FOR_PROVIDES(p, pp, name) + { + Solvable *s = pool->solvables + p; + if (s->repo != pool->installed || s->name != name || (arch && s->arch != arch)) + continue; + if (job) + queue_push(qout, job); + queue_push(qout, p); + } + } +} + void solver_get_userinstalled(Solver *solv, Queue *q, int flags) { @@ -4789,8 +4786,20 @@ } } map_free(&userinstalled); - /* convert to names if asked */ - if ((flags & GET_USERINSTALLED_NAMES) != 0) + + /* convert to desired output format */ + if ((flags & GET_USERINSTALLED_NAMEARCH) != 0) + { + int qcount = q->count; + queue_insertn(q, 0, qcount, 0); + for (i = j = 0; i < qcount; i++) + { + s = pool->solvables + q->elements[i + qcount]; + q->elements[j++] = s->name; + q->elements[j++] = s->arch; + } + } + else if ((flags & GET_USERINSTALLED_NAMES) != 0) { for (i = 0; i < q->count; i++) { @@ -4799,9 +4808,9 @@ } } /* sort and unify */ - if (q->count > 1) - get_userinstalled_sort_uniq(pool, q, flags); - /* invert if asked */ + get_userinstalled_sort_uniq(pool, q, flags); + + /* invert if asked for */ if ((flags & GET_USERINSTALLED_INVERTED) != 0) { /* first generate queue with all installed packages */ @@ -4815,30 +4824,52 @@ s = pool->solvables + p; if (!s->repo) continue; - if ((flags & GET_USERINSTALLED_NAMES) != 0) + if ((flags & GET_USERINSTALLED_NAMEARCH) != 0) + queue_push2(&invq, s->name, s->arch); + else if ((flags & GET_USERINSTALLED_NAMES) != 0) queue_push(&invq, s->name); else queue_push(&invq, p); } /* push q on invq, just in case... */ queue_insertn(&invq, invq.count, q->count, q->elements); - if (invq.count > 1) - get_userinstalled_sort_uniq(pool, &invq, flags); + get_userinstalled_sort_uniq(pool, &invq, flags); /* subtract queues (easy as they are sorted and invq is a superset of q) */ - if (q->count) + if ((flags & GET_USERINSTALLED_NAMEARCH) != 0) { - for (i = j = 0; i < invq.count; i++) - if (invq.elements[i] == q->elements[j]) - { - invq.elements[i] = 0; - if (++j >= q->count) - break; - } - queue_empty(q); + if (q->count) + { + for (i = j = 0; i < invq.count; i += 2) + if (invq.elements[i] == q->elements[j] && invq.elements[i + 1] == q->elements[j + 1]) + { + invq.elements[i] = invq.elements[i + 1] = 0; + j += 2; + if (j >= q->count) + break; + } + queue_empty(q); + } + for (i = 0; i < invq.count; i += 2) + if (invq.elements[i]) + queue_push2(q, invq.elements[i], invq.elements[i + 1]); + } + else + { + if (q->count) + { + for (i = j = 0; i < invq.count; i++) + if (invq.elements[i] == q->elements[j]) + { + invq.elements[i] = 0; + if (++j >= q->count) + break; + } + queue_empty(q); + } + for (i = 0; i < invq.count; i++) + if (invq.elements[i]) + queue_push(q, invq.elements[i]); } - for (i = j = 0; i < invq.count; i++) - if (invq.elements[i]) - queue_push(q, invq.elements[i]); queue_free(&invq); } } @@ -4848,7 +4879,7 @@ { int i; - if (flags & GET_USERINSTALLED_INVERTED) + if ((flags & GET_USERINSTALLED_INVERTED) != 0) { Queue invq; Id p, lastid; @@ -4857,13 +4888,25 @@ if (!pool->installed) return; queue_init(&invq); + if ((flags & GET_USERINSTALLED_NAMEARCH) != 0) + flags &= ~GET_USERINSTALLED_NAMES; /* just in case */ FOR_REPO_SOLVABLES(pool->installed, p, s) queue_push(&invq, flags & GET_USERINSTALLED_NAMES ? s->name : p); - queue_insertn(&invq, invq.count, q->count, q->elements); - if (invq.count > 1) - get_userinstalled_sort_uniq(pool, &invq, flags); - /* now the fun part, add q again, sort, and remove all dups */ - queue_insertn(&invq, invq.count, q->count, q->elements); + if ((flags & GET_USERINSTALLED_NAMEARCH) != 0) + { + /* for namearch we convert to packages */ + namearch2solvables(pool, q, &invq, 0); + get_userinstalled_sort_uniq(pool, &invq, flags); + namearch2solvables(pool, q, &invq, 0); + flags = 0; + } + else + { + queue_insertn(&invq, invq.count, q->count, q->elements); + get_userinstalled_sort_uniq(pool, &invq, flags); + /* now the fun part, add q again, sort, and remove all dups */ + queue_insertn(&invq, invq.count, q->count, q->elements); + } if (invq.count > 1) { if ((flags & GET_USERINSTALLED_NAMES) != 0) @@ -4891,8 +4934,13 @@ } else { - for (i = 0; i < q->count; i++) - queue_push2(job, SOLVER_USERINSTALLED | (flags & GET_USERINSTALLED_NAMES ? SOLVER_SOLVABLE_NAME : SOLVER_SOLVABLE), q->elements[i]); + if (flags & GET_USERINSTALLED_NAMEARCH) + namearch2solvables(pool, q, job, SOLVER_USERINSTALLED | SOLVER_SOLVABLE); + else + { + for (i = 0; i < q->count; i++) + queue_push2(job, SOLVER_USERINSTALLED | (flags & GET_USERINSTALLED_NAMES ? SOLVER_SOLVABLE_NAME : SOLVER_SOLVABLE), q->elements[i]); + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/src/solver.h new/libsolv-0.6.10/src/solver.h --- old/libsolv-0.6.9/src/solver.h 2015-03-04 13:25:37.000000000 +0100 +++ new/libsolv-0.6.10/src/solver.h 2015-03-26 12:46:11.000000000 +0100 @@ -296,8 +296,9 @@ #define SOLVER_FLAG_FOCUS_INSTALLED 20 #define SOLVER_FLAG_YUM_OBSOLETES 21 -#define GET_USERINSTALLED_NAMES (1 << 0) /* package names instead if ids */ +#define GET_USERINSTALLED_NAMES (1 << 0) /* package names instead of ids */ #define GET_USERINSTALLED_INVERTED (1 << 1) /* autoinstalled */ +#define GET_USERINSTALLED_NAMEARCH (1 << 2) /* package/arch tuples instead of ids */ #define SOLVER_ALTERNATIVE_TYPE_RULE 1 #define SOLVER_ALTERNATIVE_TYPE_RECOMMENDS 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/src/solver_private.h new/libsolv-0.6.10/src/solver_private.h --- old/libsolv-0.6.9/src/solver_private.h 2015-03-09 15:10:38.000000000 +0100 +++ new/libsolv-0.6.10/src/solver_private.h 2015-03-19 13:26:11.000000000 +0100 @@ -16,7 +16,6 @@ extern void solver_run_sat(Solver *solv, int disablerules, int doweak); extern void solver_reset(Solver *solv); -extern int solver_dep_installed(Solver *solv, Id dep); extern int solver_splitprovides(Solver *solv, Id dep, Map *m); static inline int @@ -42,8 +41,6 @@ } if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES) return solver_splitprovides(solv, rd->evr, 0); - if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_INSTALLED) - return solver_dep_installed(solv, rd->evr); } FOR_PROVIDES(p, pp, dep) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/test/runtestcases new/libsolv-0.6.10/test/runtestcases --- old/libsolv-0.6.9/test/runtestcases 2014-07-01 11:09:49.000000000 +0200 +++ new/libsolv-0.6.10/test/runtestcases 2015-03-20 16:36:11.000000000 +0100 @@ -3,15 +3,23 @@ cmd=$1 dir=$2 -if test -z "$dir"; then +if test -z "$cmd" -o -z "$dir"; then echo "Usage: runtestcases <cmd> <dir>"; exit 1 fi ex=0 for tc in $(find $dir -name \*.t) ; do - if ! $cmd $tc > /dev/null ; then - echo "failed test: ${tc#$dir/}" + $cmd $tc >/dev/null + tex=$? + tcn="${tc#$dir/} .................................................." + tcn="${tcn:0:50}" + if test "$tex" -eq 0 ; then + echo "$tcn Passed" + elif test "$tex" -eq 77 ; then + echo "$tcn Skipped" + else + echo "$tcn***Failed" ex=1 fi done diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/test/testcases/evrcmp/conflicts.repo new/libsolv-0.6.10/test/testcases/evrcmp/conflicts.repo --- old/libsolv-0.6.9/test/testcases/evrcmp/conflicts.repo 2014-07-01 11:09:49.000000000 +0200 +++ new/libsolv-0.6.10/test/testcases/evrcmp/conflicts.repo 2015-03-19 13:26:11.000000000 +0100 @@ -1,4 +1,4 @@ -Ver: 2.0 +=Ver: 2.0 # =Pkg: CEQ2 1 1 noarch =Con: B = 2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/test/testcases/testcase/str2dep.t new/libsolv-0.6.10/test/testcases/testcase/str2dep.t --- old/libsolv-0.6.9/test/testcases/testcase/str2dep.t 1970-01-01 01:00:00.000000000 +0100 +++ new/libsolv-0.6.10/test/testcases/testcase/str2dep.t 2015-03-23 15:16:12.000000000 +0100 @@ -0,0 +1,185 @@ +# testcase for testcase_str2dep and testcase_dep2str + +# +# first test literal escaping +# +genid dep <NULL> +result genid <inline> +#>genid 1: genid null +#>genid dep <NULL> +nextjob + +genid dep \00 +result genid <inline> +#>genid 1: genid lit +#>genid dep \00 +nextjob + +genid dep \21\20\22\23\24\25\26\27\28\29\2a\2b\2c\2d\2e\2f\3a\3b\3c\3d\3e\3f\40\5b\5c\5d\5e\5f\60\7b\7c\7d\7e +result genid <inline> +#>genid 1: genid lit ! "#$%&'()*+,-./:;<=>?@[\]^_`{|}~ +#>genid dep \21\20"#$%&'\28\29*+,-./:;<=>?@[\5c]^_`{|}~ +# make vim happy again: ' +nextjob + +genid dep foo(bar) +result genid <inline> +#>genid 1: genid lit foo(bar) +#>genid dep foo(bar) +nextjob + +genid dep foo()bar\29 +result genid <inline> +#>genid 1: genid lit foo()bar) +#>genid dep foo\28\29bar\29 +nextjob + +# +# test namespace hack +# +genid dep namespace:foo(bar) +result genid <inline> +#>genid 1: genid lit namespace:foo +#>genid 2: genid lit bar +#>genid 3: genid op <NAMESPACE> +#>genid dep namespace:foo(bar) +nextjob +genid lit namespace:foo(bar) +result genid <inline> +#>genid 1: genid lit namespace:foo(bar) +#>genid dep namespace\3afoo\28bar\29 +nextjob + +# +# test :any hack +# +genid dep foo:any +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit any +#>genid 3: genid op <MULTIARCH> +#>genid dep foo:any +nextjob +genid lit foo:any +result genid <inline> +#>genid 1: genid lit foo:any +#>genid dep foo\3aany +nextjob + +# +# test simple ops +# +genid dep foo < 1-1 +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit 1-1 +#>genid 3: genid op < +#>genid dep foo < 1-1 +nextjob + +genid dep foo = 1-1 +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit 1-1 +#>genid 3: genid op = +#>genid dep foo = 1-1 +nextjob + +genid dep foo > 1-1 +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit 1-1 +#>genid 3: genid op > +#>genid dep foo > 1-1 +nextjob + +genid dep foo >= 1-1 +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit 1-1 +#>genid 3: genid op >= +#>genid dep foo >= 1-1 +nextjob + +genid dep foo <= 1-1 +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit 1-1 +#>genid 3: genid op <= +#>genid dep foo <= 1-1 +nextjob + +# test arch op +genid dep foo . i586 +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit i586 +#>genid 3: genid op . +#>genid dep foo . i586 +nextjob + +# test haiku compat dep +genid dep foo = 2-1 compat >= 1-1 +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit 2-1 +#>genid 3: genid lit 1-1 +#>genid 4: genid op compat >= +#>genid 5: genid op = +#>genid dep foo = 2-1 compat >= 1-1 +nextjob + +# +# test complex (aka rich) deps +# + +genid dep foo & bar +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit bar +#>genid 3: genid op & +#>genid dep foo & bar +nextjob + +genid dep foo & bar & baz +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit bar +#>genid 3: genid lit baz +#>genid 4: genid op & +#>genid 5: genid op & +#>genid dep foo & bar & baz +nextjob + +genid dep foo & bar | baz +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit bar +#>genid 3: genid lit baz +#>genid 4: genid op | +#>genid 5: genid op & +#>genid dep foo & (bar | baz) +nextjob + +genid dep (foo & bar) | baz +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit bar +#>genid 3: genid op & +#>genid 4: genid lit baz +#>genid 5: genid op | +#>genid dep (foo & bar) | baz +nextjob + +genid dep (foo & bar > 2) | baz +result genid <inline> +#>genid 1: genid lit foo +#>genid 2: genid lit bar +#>genid 3: genid lit 2 +#>genid 4: genid op > +#>genid 5: genid op & +#>genid 6: genid lit baz +#>genid 7: genid op | +#>genid dep (foo & bar > 2) | baz +nextjob + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libsolv-0.6.9/tools/testsolv.c new/libsolv-0.6.10/tools/testsolv.c --- old/libsolv-0.6.9/tools/testsolv.c 2014-07-14 13:26:15.000000000 +0200 +++ new/libsolv-0.6.10/tools/testsolv.c 2015-03-23 12:51:10.000000000 +0100 @@ -18,6 +18,9 @@ { TESTCASE_RESULT_ORPHANED, "orphaned" }, { TESTCASE_RESULT_RECOMMENDED, "recommended" }, { TESTCASE_RESULT_UNNEEDED, "unneeded" }, + { TESTCASE_RESULT_ALTERNATIVES, "alternatives" }, + { TESTCASE_RESULT_RULES, "rules" }, + { TESTCASE_RESULT_GENID, "genid" }, { 0, 0 } }; @@ -131,7 +134,7 @@ if (!solv) { pool_free(pool); - exit(1); + exit(resultflags == 77 ? 77 : 1); } if (!multijob && !feof(fp))
participants (1)
-
root@hilbert.suse.de