From: Michael Schroeder Date: Tue, 11 Dec 2012 11:52:55 +0000 (+0100) Subject: support special namespace privides install/erase jobs in testcases X-Git-Tag: BASE-SuSE-Code-12_3-Branch~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d70afb28fec0cae7d679340b80999d33ba86767;p=thirdparty%2Flibsolv.git support special namespace privides install/erase jobs in testcases --- diff --git a/ext/testcase.c b/ext/testcase.c index 589aef3d..7d8e1916 100644 --- a/ext/testcase.c +++ b/ext/testcase.c @@ -657,7 +657,25 @@ testcase_str2job(Pool *pool, const char *str, Id *whatp) for (sp = pieces[2]; sp < pieces[npieces - 1]; sp++) if (*sp == 0) *sp = ' '; - what = testcase_str2dep(pool, pieces[2]); + what = 0; + if (pieces[1][0] == 'p' && strncmp(pieces[2], "namespace:", 10) == 0) + { + char *spe = strchr(pieces[2], '('); + int l = strlen(pieces[2]); + if (spe && pieces[2][l - 1] == ')') + { + /* special namespace provides */ + if (strcmp(spe, "()") != 0) + { + pieces[2][l - 1] = 0; + what = testcase_str2dep(pool, spe + 1); + pieces[2][l - 1] = ')'; + } + what = pool_rel2id(pool, pool_strn2id(pool, pieces[2], spe - pieces[2], 1), what, REL_NAMESPACE, 1); + } + } + if (!what) + what = testcase_str2dep(pool, pieces[2]); if (pieces[1][0] == 'n') job |= SOLVER_SOLVABLE_NAME; else