summaryrefslogtreecommitdiff
path: root/ext/testcase.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-09-10 15:38:44 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-09-10 15:38:44 +0900
commit79b3a6b7ab494c5ff10e740fd147f21a04907907 (patch)
tree4d4a0edc3666922135d2d2a2e4a93dd2d695ce47 /ext/testcase.c
parent26781f8c44b4495fba2d0f4a39fe6379b08f32ce (diff)
downloadlibsolv-79b3a6b7ab494c5ff10e740fd147f21a04907907.tar.gz
libsolv-79b3a6b7ab494c5ff10e740fd147f21a04907907.tar.bz2
libsolv-79b3a6b7ab494c5ff10e740fd147f21a04907907.zip
Imported Upstream version 0.7.2upstream/0.7.2
Diffstat (limited to 'ext/testcase.c')
-rw-r--r--ext/testcase.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/testcase.c b/ext/testcase.c
index ffc8b8a..b815c56 100644
--- a/ext/testcase.c
+++ b/ext/testcase.c
@@ -15,6 +15,7 @@
#include "pool.h"
#include "poolarch.h"
#include "poolvendor.h"
+#include "evr.h"
#include "repo.h"
#include "repo_solv.h"
#include "solver.h"
@@ -121,6 +122,7 @@ static struct solverflags2str {
{ SOLVER_FLAG_FOCUS_BEST, "focusbest", 0 },
{ SOLVER_FLAG_STRONG_RECOMMENDS, "strongrecommends", 0 },
{ SOLVER_FLAG_INSTALL_ALSO_UPDATES, "installalsoupdates", 0 },
+ { SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED, "onlynamespacerecommended", 0 },
{ 0, 0, 0 }
};
@@ -1071,7 +1073,7 @@ testcase_str2job(Pool *pool, const char *str, Id *whatp)
Queue q;
job |= SOLVER_SOLVABLE_ONE_OF;
queue_init(&q);
- if (npieces > 3 && strcmp(pieces[2], "nothing") != 0)
+ if (npieces > 2 && strcmp(pieces[2], "nothing") != 0)
{
for (i = 2; i < npieces; i++)
{
@@ -2966,6 +2968,14 @@ testcase_read(Pool *pool, FILE *fp, const char *testcase, Queue *job, char **res
}
queue_push(&autoinstq, pool_str2id(pool, pieces[2], 1));
}
+ else if (!strcmp(pieces[0], "evrcmp") && npieces == 3)
+ {
+ Id evr1 = pool_str2id(pool, pieces[1], 1);
+ Id evr2 = pool_str2id(pool, pieces[2], 1);
+ int r = pool_evrcmp(pool, evr1, evr2, EVRCMP_COMPARE);
+ r = r < 0 ? REL_LT : r > 0 ? REL_GT : REL_EQ;
+ queue_push2(job, SOLVER_NOOP | SOLVER_SOLVABLE_PROVIDES, pool_rel2id(pool, evr1, evr2, r, 1));
+ }
else
{
pool_error(pool, 0, "testcase_read: cannot parse command '%s'", pieces[0]);