diff options
author | Michael Schroeder <mls@suse.de> | 2012-12-11 12:52:55 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-12-11 12:52:55 +0100 |
commit | 0d70afb28fec0cae7d679340b80999d33ba86767 (patch) | |
tree | 539f268bd60a37afa1bd88de0057ece871713b75 | |
parent | 6d567daed91cd8c0ca20e3d680f0b94012fa8df3 (diff) | |
download | libsolv-0d70afb28fec0cae7d679340b80999d33ba86767.tar.gz libsolv-0d70afb28fec0cae7d679340b80999d33ba86767.tar.bz2 libsolv-0d70afb28fec0cae7d679340b80999d33ba86767.zip |
support special namespace privides install/erase jobs in testcases
-rw-r--r-- | ext/testcase.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/ext/testcase.c b/ext/testcase.c index 589aef3..7d8e191 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, "(<NULL>)") != 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 |