summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:52:55 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2016-10-27 14:53:17 +0900
commitba4d7201b44ecec1182b53571d98b2be4ca50264 (patch)
tree099cf6127f7020528a4d05083fc059cbf3ad7db5 /ext
parent1be9896f3702c4996e1a43e1c9b5c18366ff42b9 (diff)
downloadlibsolv-ba4d7201b44ecec1182b53571d98b2be4ca50264.tar.gz
libsolv-ba4d7201b44ecec1182b53571d98b2be4ca50264.tar.bz2
libsolv-ba4d7201b44ecec1182b53571d98b2be4ca50264.zip
Imported Upstream version 0.6.5upstream/0.6.5
Change-Id: If69a2170a61800e3f778ec1f78364531c9642950 Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'ext')
-rw-r--r--ext/repo_arch.c6
-rw-r--r--ext/testcase.c40
2 files changed, 41 insertions, 5 deletions
diff --git a/ext/repo_arch.c b/ext/repo_arch.c
index 394e8b5..a0c45ce 100644
--- a/ext/repo_arch.c
+++ b/ext/repo_arch.c
@@ -294,13 +294,13 @@ adddep(Repo *repo, Offset olddeps, char *line)
char *p;
Id id;
- while (*line == ' ' && *line == '\t')
+ while (*line == ' ' || *line == '\t')
line++;
p = line;
while (*p && *p != ' ' && *p != '\t' && *p != '<' && *p != '=' && *p != '>')
p++;
id = pool_strn2id(pool, line, p - line, 1);
- while (*p == ' ' && *p == '\t')
+ while (*p == ' ' || *p == '\t')
p++;
if (*p == '<' || *p == '=' || *p == '>')
{
@@ -316,7 +316,7 @@ adddep(Repo *repo, Offset olddeps, char *line)
else
break;
}
- while (*p == ' ' && *p == '\t')
+ while (*p == ' ' || *p == '\t')
p++;
line = p;
while (*p && *p != ' ' && *p != '\t')
diff --git a/ext/testcase.c b/ext/testcase.c
index 3da7aff..fa9c807 100644
--- a/ext/testcase.c
+++ b/ext/testcase.c
@@ -105,6 +105,7 @@ static struct solverflags2str {
{ SOLVER_FLAG_KEEP_ORPHANS, "keeporphans", 0 },
{ SOLVER_FLAG_BREAK_ORPHANS, "breakorphans", 0 },
{ SOLVER_FLAG_FOCUS_INSTALLED, "focusinstalled", 0 },
+ { SOLVER_FLAG_YUM_OBSOLETES, "yumobsoletes", 0 },
{ 0, 0, 0 }
};
@@ -1728,6 +1729,18 @@ testcase_write(Solver *solv, char *dir, int resultflags, const char *testcasenam
}
}
+ /* dump disabled packages (must come before the namespace/job lines) */
+ if (pool->considered)
+ {
+ Id p;
+ FOR_POOL_SOLVABLES(p)
+ if (!MAPTST(pool->considered, p))
+ {
+ cmd = pool_tmpjoin(pool, "disable pkg ", testcase_solvid2str(pool, p), 0);
+ strqueue_push(&sq, cmd);
+ }
+ }
+
s = testcase_getsolverflags(solv);
if (*s)
{
@@ -2116,7 +2129,7 @@ testcase_read(Pool *pool, FILE *fp, char *testcase, Queue *job, char **resultp,
{
char *sp;
Id how, what;
- if (!prepared)
+ if (prepared <= 0)
{
pool_addfileprovides(pool);
pool_createwhatprovides(pool);
@@ -2162,7 +2175,7 @@ testcase_read(Pool *pool, FILE *fp, char *testcase, Queue *job, char **resultp,
for (i = 2; i < npieces; i++)
queue_push(&q, testcase_str2solvid(pool, pieces[i]));
/* now do the callback */
- if (!prepared)
+ if (prepared <= 0)
{
pool_addfileprovides(pool);
pool_createwhatprovides(pool);
@@ -2227,6 +2240,29 @@ testcase_read(Pool *pool, FILE *fp, char *testcase, Queue *job, char **resultp,
{
break;
}
+ else if (!strcmp(pieces[0], "disable") && npieces == 3)
+ {
+ Id p;
+ if (strcmp(pieces[1], "pkg"))
+ {
+ pool_debug(pool, SOLV_ERROR, "testcase_read: bad disable type '%s'\n", pieces[1]);
+ continue;
+ }
+ if (!prepared)
+ pool_createwhatprovides(pool);
+ prepared = -1;
+ if (!pool->considered)
+ {
+ pool->considered = solv_calloc(1, sizeof(Map));
+ map_init(pool->considered, pool->nsolvables);
+ map_setall(pool->considered);
+ }
+ p = testcase_str2solvid(pool, pieces[2]);
+ if (p)
+ MAPCLR(pool->considered, p);
+ else
+ pool_debug(pool, SOLV_ERROR, "disable: unknown package '%s'\n", pieces[2]);
+ }
else
{
pool_debug(pool, SOLV_ERROR, "testcase_read: cannot parse command '%s'\n", pieces[0]);