From: Michael Schroeder Date: Tue, 21 Feb 2012 12:46:19 +0000 (+0100) Subject: - allow <> dep in susetags, special case pattern: in packageand(), add SOLVER_TRANSAC... X-Git-Tag: BASE-SuSE-Code-12_2-Branch~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce30350582fa39699ad597d74a21db7e8ebadd58;p=thirdparty%2Flibsolv.git - allow <> dep in susetags, special case pattern: in packageand(), add SOLVER_TRANSACTION_KEEP_PSEUDO --- diff --git a/ext/repo_susetags.c b/ext/repo_susetags.c index 9e835725..1a55f65e 100644 --- a/ext/repo_susetags.c +++ b/ext/repo_susetags.c @@ -106,8 +106,13 @@ adddep(Pool *pool, struct parsedata *pd, unsigned int olddeps, char *line, Id ma break; if (flags == 6) { - pool_debug(pool, SOLV_FATAL, "susetags: unknown relation in %d: '%s'\n", pd->lineno, sp[1]); - exit(1); + if (!strcmp(sp[1], "<>")) + flags = 4; + else + { + pool_debug(pool, SOLV_FATAL, "susetags: unknown relation in %d: '%s'\n", pd->lineno, sp[1]); + exit(1); + } } id = pool_rel2id(pool, id, evrid, flags + 1, 1); } diff --git a/ext/testcase.c b/ext/testcase.c index 6129657c..287c2a64 100644 --- a/ext/testcase.c +++ b/ext/testcase.c @@ -315,7 +315,7 @@ testcase_repoid2str(Pool *pool, Id repoid) else { char buf[20]; - sprintf(buf, "@#%d", repoid); + sprintf(buf, "#%d", repoid); return pool_tmpjoin(pool, buf, 0, 0); } } @@ -1229,7 +1229,7 @@ testcase_solverresult(Solver *solv, int resultflags) for (i = 0; class2str[i].str; i++) { queue_empty(&q); - transaction_classify_pkgs(trans, 0, class2str[i].class, 0, 0, &q); + transaction_classify_pkgs(trans, SOLVER_TRANSACTION_KEEP_PSEUDO, class2str[i].class, 0, 0, &q); for (j = 0; j < q.count; j++) { p = q.elements[j]; @@ -1589,20 +1589,23 @@ testcase_read(Pool *pool, FILE *fp, char *testcase, Queue *job, char **resultp, } repo->priority = prio; repo->subpriority = subprio; - rdata = pool_tmpjoin(pool, testcasedir, pieces[4], 0); - if ((rfp = solv_xfopen(rdata, "r")) == 0) + if (strcmp(pieces[3], "empty") != 0) { - pool_debug(pool, SOLV_ERROR, "testcase_read: could not open '%s'\n", rdata); - } - else if (!strcmp(pieces[3], "susetags")) - { - testcase_add_susetags(repo, rfp, 0); - fclose(rfp); - } - else - { - fclose(rfp); - pool_debug(pool, SOLV_ERROR, "testcase_read: unknown repo type for repo '%s'\n", repo->name); + rdata = pool_tmpjoin(pool, testcasedir, pieces[4], 0); + if ((rfp = solv_xfopen(rdata, "r")) == 0) + { + pool_debug(pool, SOLV_ERROR, "testcase_read: could not open '%s'\n", rdata); + } + else if (!strcmp(pieces[3], "susetags")) + { + testcase_add_susetags(repo, rfp, 0); + fclose(rfp); + } + else + { + fclose(rfp); + pool_debug(pool, SOLV_ERROR, "testcase_read: unknown repo type for repo '%s'\n", repo->name); + } } } else if (!strcmp(pieces[0], "system") && npieces >= 3) diff --git a/src/evr.c b/src/evr.c index 4942d404..c8cc940f 100644 --- a/src/evr.c +++ b/src/evr.c @@ -166,6 +166,8 @@ pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode) s1 = evr1; s2 = evr2; } + + /* compare the epoch */ if (s1 == evr1 || *s1 != ':') s1 = 0; if (s2 == evr2 || *s2 != ':') @@ -197,6 +199,8 @@ pool_evrcmp_str(const Pool *pool, const char *evr1, const char *evr2, int mode) return -1; evr2 = s2 + 1; } + + /* same epoch, now split into version/release */ for (s1 = evr1, r1 = 0; *s1; s1++) if (*s1 == '-') r1 = s1; diff --git a/src/repo.c b/src/repo.c index b61bd0c6..4cda4815 100644 --- a/src/repo.c +++ b/src/repo.c @@ -714,6 +714,13 @@ repo_fix_supplements(Repo *repo, Offset provides, Offset supplements, Offset fre dep = p + 1; continue; } + /* argh, allow pattern: prefix. sigh */ + if (p - dep == 7 && !strncmp(dep, "pattern", 7)) + { + p = strchr(p + 1, ':'); + if (!p) + break; + } *p++ = 0; idp = pool_str2id(pool, dep, 1); if (id) diff --git a/src/transaction.c b/src/transaction.c index aa6d77c1..d0db631b 100644 --- a/src/transaction.c +++ b/src/transaction.c @@ -205,16 +205,18 @@ transaction_type(Transaction *trans, Id p, int mode) Queue oq, rq; Id type, q; int i, j, ref = 0; - const char *n; if (!s->repo) return SOLVER_TRANSACTION_IGNORE; - n = pool_id2str(pool, s->name); - if (!strncmp(n, "patch:", 6)) - return SOLVER_TRANSACTION_IGNORE; - if (!strncmp(n, "pattern:", 8)) - return SOLVER_TRANSACTION_IGNORE; + if (!(mode & SOLVER_TRANSACTION_KEEP_PSEUDO)) + { + const char *n = pool_id2str(pool, s->name); + if (!strncmp(n, "patch:", 6)) + return SOLVER_TRANSACTION_IGNORE; + if (!strncmp(n, "pattern:", 8)) + return SOLVER_TRANSACTION_IGNORE; + } type = transaction_base_type(trans, p); diff --git a/src/transaction.h b/src/transaction.h index 2b55331e..c9f93435 100644 --- a/src/transaction.h +++ b/src/transaction.h @@ -75,6 +75,8 @@ typedef struct _Transaction { #define SOLVER_TRANSACTION_RPM_ONLY (1 << 7) +#define SOLVER_TRANSACTION_KEEP_PSEUDO (1 << 8) + /* extra classifications */ #define SOLVER_TRANSACTION_ARCHCHANGE 0x100 #define SOLVER_TRANSACTION_VENDORCHANGE 0x101