15 #include "repo_solv.h"
16 #include "repo_write.h"
19 main(int argc, char **argv)
21 Pool *pool = pool_create();
30 if ((fp = fopen(*argv, "r")) == NULL)
35 pool_addrepo_solv(pool, fp, "");
42 for (i = 0; i < pool->nrepos; i++)
43 new_id_size += pool->repos[i]->idarraysize;
44 new_id = (Id*) malloc (sizeof (Id) * new_id_size);
46 for (i = 0; i < pool->nrepos; i++)
48 Repo *repo = pool->repos[i];
50 memcpy (new_id + new_id_size, repo->idarraydata,
51 repo->idarraysize * sizeof (new_id[0]));
52 for (si = repo->start; si < repo->start + repo->nsolvables; si++)
54 Solvable *s = pool->solvables + si;
56 s->provides += new_id_size;
58 s->obsoletes += new_id_size;
60 s->conflicts += new_id_size;
62 s->requires += new_id_size;
64 s->recommends += new_id_size;
66 s->suggests+= new_id_size;
68 s->supplements += new_id_size;
70 s->enhances += new_id_size;
72 s->freshens += new_id_size;
74 new_id_size += repo->idarraysize;
77 pool->repos[0]->nsolvables += repo->nsolvables;
79 repo->start = pool->nsolvables;
80 free (repo->idarraydata);
81 repo->idarraydata = 0;
84 while (pool->nrepos > 1)
86 pool_freerepo (pool, pool->repos[1]);
88 free (pool->repos[0]->idarraydata);
89 pool->repos[0]->idarraydata = new_id;
90 pool->repos[0]->idarraysize = new_id_size;
92 pool_writerepo(pool, pool->repos[0], stdout);