+parse_trackfeatures(struct parsedata *pd, struct solv_jsonparser *jp, Id handle)
+{
+ int type = JP_ARRAY;
+ while (type > 0 && (type = jsonparser_parse(jp)) > 0 && type != JP_ARRAY_END)
+ {
+ if (type == JP_STRING)
+ {
+ char *p = jp->value, *pe;
+ while (*p == ' ' || *p == '\t')
+ p++;
+ if (!*p)
+ continue;
+ for (pe = p + strlen(p) - 1; pe > p; pe--)
+ if (*pe != ' ' && *pe != '\t')
+ break;
+ repodata_add_idarray(pd->data, handle, SOLVABLE_TRACK_FEATURES, pool_strn2id(pd->pool, p, pe - p + 1, 1));
+ }
+ else
+ type = jsonparser_skip(jp, type);
+ }
+ return type;
+}
+
+static void
+swap_solvables(Repo *repo, Repodata *data, Id pa, Id pb)
+{
+ Pool *pool = repo->pool;
+ Solvable tmp;
+
+ tmp = pool->solvables[pa];
+ pool->solvables[pa] = pool->solvables[pb];
+ pool->solvables[pb] = tmp;
+ repodata_swap_attrs(data, pa, pb);
+}
+
+static Id *
+fn2data(struct parsedata *pd, const char *fn, Id *fntypep, int create)
+{
+ size_t l = strlen(fn), extl = 0;
+ Id fnid;
+ if (l > 6 && !strcmp(fn + l - 6, ".conda"))
+ extl = 6;
+ else if (l > 8 && !strcmp(fn + l - 8, ".tar.bz2"))
+ extl = 8;
+ else
+ return 0;
+ fnid = stringpool_strn2id(&pd->fnpool, fn, l - extl, create);
+ if (!fnid)
+ return 0;
+ if (fnid * 2 + 2 > pd->fndata.count)
+ queue_insertn(&pd->fndata, pd->fndata.count, fnid * 2 + 2 - pd->fndata.count, 0);
+ if (fntypep)
+ *fntypep = extl == 8 ? 1 : 2; /* 1: legacy .tar.bz2 2: .conda */
+ return pd->fndata.elements + 2 * fnid;
+}
+
+static int