From: Michael Schroeder Date: Fri, 5 Jul 2013 16:07:24 +0000 (+0200) Subject: fix testcase handling of haiku's compat deps X-Git-Tag: BASE-SuSE-Code-13_1-Branch~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09387351f51bd0a6c6434b12bc50f2e83590954d;p=thirdparty%2Flibsolv.git fix testcase handling of haiku's compat deps --- diff --git a/ext/testcase.c b/ext/testcase.c index 8cb9b9c5..3d62437f 100644 --- a/ext/testcase.c +++ b/ext/testcase.c @@ -290,7 +290,7 @@ Id testcase_str2dep(Pool *pool, char *s) { char *n, *a; - Id id; + Id id, evr; int flags; if ((n = strchr(s, '|')) != 0) @@ -348,11 +348,6 @@ testcase_str2dep(Pool *pool, char *s) else break; } - if (!flags && *s == 'c' && !strcmp(s, "compat >=")) - { - flags = REL_COMPAT; - s += 9; - } if (!flags) return id; while (*s == ' ' || *s == '\t') @@ -360,7 +355,18 @@ testcase_str2dep(Pool *pool, char *s) n = s; while (*s && *s != ' ' && *s != '\t') s++; - return pool_rel2id(pool, id, pool_strn2id(pool, n, s - n, 1), flags, 1); + evr = pool_strn2id(pool, n, s - n, 1); + if (*s == ' ' && !strcmp(s, " compat >= ")) + { + s += 11; + while (*s == ' ' || *s == '\t') + s++; + n = s; + while (*s && *s != ' ' && *s != '\t') + s++; + evr = pool_rel2id(pool, evr, pool_strn2id(pool, n, s - n, 1), REL_COMPAT, 1); + } + return pool_rel2id(pool, id, evr, flags, 1); } const char *