else if (!strncmp(line, "arch = ", 7))
s->arch = pool_str2id(pool, line + 7, 1);
else if (!strncmp(line, "license = ", 10))
- repodata_set_poolstr(data, s - pool->solvables, SOLVABLE_LICENSE, line + 10);
+ repodata_add_poolstr_array(data, s - pool->solvables, SOLVABLE_LICENSE, line + 10);
else if (!strncmp(line, "replaces = ", 11))
s->obsoletes = adddep(repo, s->obsoletes, line + 11);
else if (!strncmp(line, "group = ", 8))
- repodata_set_poolstr(data, s - pool->solvables, SOLVABLE_GROUP, line + 8);
+ repodata_add_poolstr_array(data, s - pool->solvables, SOLVABLE_GROUP, line + 8);
else if (!strncmp(line, "depend = ", 9))
s->requires = adddep(repo, s->requires, line + 9);
else if (!strncmp(line, "optdepend = ", 12))
else if (!strcmp(line, "%GROUPS%"))
{
if (getsentrynl(th, line, sizeof(line)))
- repodata_set_poolstr(data, s - pool->solvables, SOLVABLE_GROUP, line);
+ repodata_add_poolstr_array(data, s - pool->solvables, SOLVABLE_GROUP, line);
}
else if (!strcmp(line, "%CSIZE%"))
{
else if (!strcmp(line, "%LICENSE%"))
{
if (getsentrynl(th, line, sizeof(line)))
- repodata_set_poolstr(data, s - pool->solvables, SOLVABLE_LICENSE, line);
+ repodata_add_poolstr_array(data, s - pool->solvables, SOLVABLE_LICENSE, line);
}
else if (!strcmp(line, "%ARCH%"))
{
return repo_lookup_deparray(s->repo, s - s->repo->pool->solvables, keyname, q, marker);
}
+static const char *
+solvable_lookup_str_joinarray(Solvable *s, Id keyname)
+{
+ Queue q;
+ Id qbuf[10];
+ char *str = 0;
+
+ queue_init_buffer(&q, qbuf, sizeof(qbuf)/sizeof(*qbuf));
+ if (solvable_lookup_idarray(s, keyname, &q) && q.count)
+ {
+ Pool *pool = s->repo->pool;
+ int i;
+ str = pool_tmpjoin(pool, pool_id2str(pool, q.elements[0]), 0, 0);
+ for (i = 1; i < q.count; i++)
+ str = pool_tmpappend(pool, str, ", ", pool_id2str(pool, q.elements[i]));
+ }
+ queue_free(&q);
+ return str;
+}
+
const char *
solvable_lookup_str(Solvable *s, Id keyname)
{
+ const char *str;
if (!s->repo)
return 0;
- return repo_lookup_str(s->repo, s - s->repo->pool->solvables, keyname);
+ str = repo_lookup_str(s->repo, s - s->repo->pool->solvables, keyname);
+ if (!str && (keyname == SOLVABLE_LICENSE || keyname == SOLVABLE_GROUP))
+ str = solvable_lookup_str_joinarray(s, keyname);
+ return str;
}
static const char *