{
Id *pp;
s = pool->solvables + i;
- pp = s->provides;
- if (!pp) /* solvable does not provide anything */
+ if (!s->provides)
continue;
if (!pool_installable(pool, s))
continue;
+ pp = s->source->idarraydata + s->provides;
while ((id = *pp++) != ID_NULL)
{
if (ISRELDEP(id))
{
Id *pp;
s = pool->solvables + i;
- pp = s->provides;
- if (!pp) /* solvable does not provide anything */
+ if (!s->provides)
continue;
if (!pool_installable(pool, s))
continue;
/* for all provides of this solvable */
+ pp = s->source->idarraydata + s->provides;
while ((id = *pp++) != 0)
{
if (ISRELDEP(id))
printf("addrelproviders: checking package %s\n", id2str(pool, pool->p[p].name));
#endif
/* solvable p provides name in some rels */
- for (pidp = pool->solvables[p].provides; (pid = *pidp++) != 0; )
+ pidp = pool->solvables[p].source->idarraydata + pool->solvables[p].provides;
+ while ((pid = *pidp++) != 0)
{
int pflags;
Id pevr;
Source *source; /* source we belong to */
- /* dependencies are pointers into idarray of source */
- Id *provides; /* terminated with Id 0 */
- Id *obsoletes;
- Id *conflicts;
+ /* dependencies are offsets into idarray of source */
+ Offset provides; /* terminated with Id 0 */
+ Offset obsoletes;
+ Offset conflicts;
- Id *requires;
- Id *recommends;
- Id *suggests;
+ Offset requires;
+ Offset recommends;
+ Offset suggests;
- Id *supplements;
- Id *enhances;
+ Offset supplements;
+ Offset enhances;
- Id *freshens;
+ Offset freshens;
} Solvable;
#endif /* SOLVABLE_H */
if (p < 0)
continue;
s = pool->solvables + p;
- if ((recp = s->recommends) != 0)
- while ((rec = *recp++) != 0)
- FOR_PROVIDES(p, pp, rec)
- MAPSET(&solv->recommendsmap, p);
- if ((sugp = s->suggests) != 0)
- while ((sug = *sugp++) != 0)
- FOR_PROVIDES(p, pp, sug)
- MAPSET(&solv->suggestsmap, p);
+ if (s->recommends)
+ {
+ recp = s->source->idarraydata + s->recommends;
+ while ((rec = *recp++) != 0)
+ FOR_PROVIDES(p, pp, rec)
+ MAPSET(&solv->recommendsmap, p);
+ }
+ if (s->suggests)
+ {
+ sugp = s->source->idarraydata + s->suggests;
+ while ((sug = *sugp++) != 0)
+ FOR_PROVIDES(p, pp, sug)
+ MAPSET(&solv->suggestsmap, p);
+ }
}
/* prune to recommended/supplemented */
for (i = j = 0; i < plist->count; i++)
s = pool->solvables + p;
if (!s->supplements && !s->freshens)
continue;
- if ((supp = s->supplements) != 0)
+ if (s->supplements)
{
+ supp = s->source->idarraydata + s->supplements;
while ((sup = *supp++) != 0)
if (dep_fulfilled(solv, sup))
break;
if (!sup)
continue;
}
- if ((supp = s->freshens) != 0)
+ if (s->freshens)
{
+ supp = s->source->idarraydata + s->freshens;
while ((sup = *supp++) != 0)
if (dep_fulfilled(solv, sup))
break;
continue;
}
s = pool->solvables + p;
- if (!(enhp = s->enhances))
+ if (!s->enhances)
continue;
+ enhp = s->source->idarraydata + s->enhances;
while ((enh = *enhp++) != 0)
if (dep_fulfilled(solv, enh))
break;
* check requires of s
*/
- if ((reqp = s->requires) != ID_NULL)
+ if (s->requires)
{
- while ((req = *reqp++) != ID_NULL)
+ reqp = s->source->idarraydata + s->requires;
+ while ((req = *reqp++) != 0)
{
if (req == SOLVABLE_PREREQMARKER) /* skip the marker */
continue;
* check conflicts of s
*/
- if ((conp = s->conflicts) != 0)
+ if (s->conflicts)
{
+ conp = s->source->idarraydata + s->conflicts;
while ((con = *conp++) != 0)
{
FOR_PROVIDES(p, pp, con)
*/
if (!system || n < system->start || n >= (system->start + system->nsolvables))
{ /* not installed */
- if ((obsp = s->obsoletes) != 0)
+ if (s->obsoletes)
{
+ obsp = s->source->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
{
FOR_PROVIDES(p, pp, obs)
/*-----------------------------------------
* add recommends to the rule list
*/
- if ((recp = s->recommends) != 0)
- while ((rec = *recp++) != 0)
- {
- FOR_PROVIDES(p, pp, rec)
- if (!MAPTST(m, p))
- queuepush(&q, p);
- }
+ if (s->recommends)
+ {
+ recp = s->source->idarraydata + s->recommends;
+ while ((rec = *recp++) != 0)
+ {
+ FOR_PROVIDES(p, pp, rec)
+ if (!MAPTST(m, p))
+ queuepush(&q, p);
+ }
+ }
}
queuefree(&q);
}
if (!pool_installable(pool, s))
continue;
sup = 0;
- if ((supp = s->supplements) != 0)
- while ((sup = *supp++) != ID_NULL)
- if (dep_possible(solv, sup, m))
- break;
- if (!sup && (supp = s->freshens) != 0)
- while ((sup = *supp++) != ID_NULL)
- if (dep_possible(solv, sup, m))
- break;
+ if (s->supplements)
+ {
+ supp = s->source->idarraydata + s->supplements;
+ while ((sup = *supp++) != ID_NULL)
+ if (dep_possible(solv, sup, m))
+ break;
+ }
+ if (!sup && s->freshens)
+ {
+ supp = s->source->idarraydata + s->freshens;
+ while ((sup = *supp++) != ID_NULL)
+ if (dep_possible(solv, sup, m))
+ break;
+ }
if (!sup)
continue;
addrulesforsolvable(solv, s, m);
if (MAPTST(m, i))
continue;
s = pool->solvables + i;
- if ((enhp = s->enhances) == 0)
+ if (!s->enhances)
continue;
if (!pool_installable(pool, s))
continue;
+ enhp = s->source->idarraydata + s->enhances;
while ((enh = *enhp++) != ID_NULL)
if (dep_possible(solv, enh, m))
break;
if (!enh)
continue;
- if ((conp = s->conflicts) != 0)
- while ((con = *conp++) != 0)
- FOR_PROVIDES(p, pp, con)
- addrule(solv, -i, -p);
- if ((obsp = s->obsoletes) != 0)
- while ((obs = *obsp++) != ID_NULL)
- FOR_PROVIDES(p, pp, obs)
- addrule(solv, -i, -p);
+ if (s->conflicts)
+ {
+ conp = s->source->idarraydata + s->conflicts;
+ while ((con = *conp++) != 0)
+ FOR_PROVIDES(p, pp, con)
+ addrule(solv, -i, -p);
+ }
+ if (s->obsoletes)
+ {
+ obsp = s->source->idarraydata + s->obsoletes;
+ while ((obs = *obsp++) != ID_NULL)
+ FOR_PROVIDES(p, pp, obs)
+ addrule(solv, -i, -p);
+ }
FOR_PROVIDES(p, pp, s->name)
if (s->name == pool->solvables[p].name)
addrule(solv, -i, -p);
Pool *pool = solv->pool;
Id p, *pp, n, p2, *pp2;
Id obs, *obsp;
+ Solvable *ps;
QUEUEEMPTY(qs);
/*
if (p == n) /* skip itself */
continue;
- if (s->name == pool->solvables[p].name) /* name match */
+ ps = pool->solvables + p;
+ if (s->name == ps->name) /* name match */
{
if (!allowdowngrade /* consider downgrades ? */
- && evrcmp(pool, s->evr, pool->solvables[p].evr) > 0)
+ && evrcmp(pool, s->evr, ps->evr) > 0)
continue;
/* XXX */
- if (!allowarchchange && archchanges(pool, s, pool->solvables + p))
+ if (!allowarchchange && archchanges(pool, s, ps))
continue;
}
- else if (!solv->noupdateprovide && (obsp = pool->solvables[p].obsoletes) != 0) /* provides/obsoletes combination ? */
+ else if (!solv->noupdateprovide && ps->obsoletes) /* provides/obsoletes combination ? */
{
+ obsp = ps->source->idarraydata + ps->obsoletes;
while ((obs = *obsp++) != 0) /* for all obsoletes */
{
FOR_PROVIDES(p2, pp2, obs) /* and all matching providers of the obsoletes */
s = pool->solvables + i;
/* installed, check for recommends */
/* XXX need to special case AND ? */
- if ((recp = s->recommends) != 0)
+ if (s->recommends)
{
+ recp = s->source->idarraydata + s->recommends;
while ((rec = *recp++) != 0)
{
qcount = dq.count;
continue;
if (!pool_installable(pool, s))
continue;
- if ((supp = s->supplements) != 0)
+ if (s->supplements)
{
+ supp = s->source->idarraydata + s->supplements;
while ((sup = *supp++) != 0)
if (dep_fulfilled(solv, sup))
break;
if (!sup)
continue;
}
- if ((supp = s->freshens) != 0)
+ if (s->freshens)
{
+ supp = s->source->idarraydata + s->freshens;
while ((sup = *supp++) != 0)
if (dep_fulfilled(solv, sup))
break;
if (n >= solv->system->start && n < solv->system->start + solv->system->nsolvables)
continue;
s = pool->solvables + n;
- if ((obsp = s->obsoletes) != 0)
- while ((obs = *obsp++) != 0)
- FOR_PROVIDES(p, pp, obs)
- {
- if (p >= solv->system->start && p < solv->system->start + solv->system->nsolvables)
- {
- obsoletesmap[p] = n;
- obsoletesmap[n]++;
- }
- }
+ if (s->obsoletes)
+ {
+ obsp = s->source->idarraydata + s->obsoletes;
+ while ((obs = *obsp++) != 0)
+ FOR_PROVIDES(p, pp, obs)
+ {
+ if (p >= solv->system->start && p < solv->system->start + solv->system->nsolvables)
+ {
+ obsoletesmap[p] = n;
+ obsoletesmap[n]++;
+ }
+ }
+ }
FOR_PROVIDES(p, pp, s->name)
if (s->name == pool->solvables[p].name)
{
for (i = 1; i < pool->nsolvables; i++)
{
s = pool->solvables + i;
- if ((obsp = s->obsoletes) == 0)
+ if (!s->obsoletes)
continue;
if (!pool_installable(pool, s))
continue;
+ obsp = s->source->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
FOR_PROVIDES(p, pp, obs)
{
for (i = pool->nsolvables - 1; i > 0; i--)
{
s = pool->solvables + i;
- if ((obsp = s->obsoletes) == 0)
+ if (!s->obsoletes)
continue;
if (!pool_installable(pool, s))
continue;
+ obsp = s->source->idarraydata + s->obsoletes;
while ((obs = *obsp++) != 0)
FOR_PROVIDES(p, pp, obs)
{
if (p < 0)
continue;
s = pool->solvables + p;
- if ((sugp = s->suggests) != 0)
- while ((sug = *sugp++) != 0)
- {
- FOR_PROVIDES(p, pp, sug)
- if (solv->decisionmap[p] > 0)
- break;
- if (p)
- continue; /* already fulfilled */
- FOR_PROVIDES(p, pp, sug)
- MAPSET(&solv->suggestsmap, p);
- }
+ if (s->suggests)
+ {
+ sugp = s->source->idarraydata + s->suggests;
+ while ((sug = *sugp++) != 0)
+ {
+ FOR_PROVIDES(p, pp, sug)
+ if (solv->decisionmap[p] > 0)
+ break;
+ if (p)
+ continue; /* already fulfilled */
+ FOR_PROVIDES(p, pp, sug)
+ MAPSET(&solv->suggestsmap, p);
+ }
+ }
}
for (i = 1; i < pool->nsolvables; i++)
{
s = pool->solvables + i;
if (!MAPTST(&solv->suggestsmap, i))
{
- if ((enhp = s->enhances) == 0)
+ if (!s->enhances)
continue;
if (!pool_installable(pool, s))
continue;
+ enhp = s->source->idarraydata + s->enhances;
while ((enh = *enhp++) != 0)
if (dep_fulfilled(solv, enh))
break;
continue;
}
/* check if installation is possible at all */
- if ((reqp = s->requires) != 0)
+ if (s->requires)
{
+ reqp = s->source->idarraydata + s->requires;
while ((req = *reqp++) != 0)
{
if (req == SOLVABLE_PREREQMARKER) /* skip the marker */
SolvData *solvdata;
unsigned int size, size_str, size_idarray;
Source *source;
- Id *idarraydatap, *idarraydataend, *ida;
+ Id *idarraydatap, *idarraydataend;
+ Offset ido;
unsigned int databits;
Solvable *s;
exit(1);
}
if (size_idarray)
- source->idarraydata = (Id *)xmalloc(sizeof(Id) * size_idarray);
- source->idarraysize = size_idarray;
- idarraydatap = source->idarraydata;
- idarraydataend = source->idarraydata + size_idarray;
+ {
+ size_idarray++; /* first entry is not used */
+ source->idarraydata = (Id *)xmalloc(sizeof(Id) * size_idarray);
+ source->idarraysize = size_idarray;
+ idarraydatap = source->idarraydata + 1;
+ idarraydataend = source->idarraydata + size_idarray;
+ }
+ else
+ {
+ source->idarraydata = 0;
+ source->idarraysize = 0;
+ idarraydatap = 0;
+ idarraydataend = 0;
+ }
/* alloc solvables */
pool->solvables = (Solvable *)xrealloc(pool->solvables, (pool->nsolvables + numsolv) * sizeof(Solvable));
;
break;
}
- ida = idarraydatap;
- idarraydatap = read_idarray(fp, numid + numrel, idmap, ida, idarraydataend);
+ ido = idarraydatap - source->idarraydata;
+ idarraydatap = read_idarray(fp, numid + numrel, idmap, idarraydatap, idarraydataend);
if (id == SOLVABLE_PROVIDES)
- s->provides = ida;
+ s->provides = ido;
else if (id == SOLVABLE_OBSOLETES)
- s->obsoletes = ida;
+ s->obsoletes = ido;
else if (id == SOLVABLE_CONFLICTS)
- s->conflicts = ida;
+ s->conflicts = ido;
else if (id == SOLVABLE_REQUIRES)
- s->requires = ida;
+ s->requires = ido;
else if (id == SOLVABLE_RECOMMENDS)
- s->recommends= ida;
+ s->recommends= ido;
else if (id == SOLVABLE_SUPPLEMENTS)
- s->supplements = ida;
+ s->supplements = ido;
else if (id == SOLVABLE_SUGGESTS)
- s->suggests = ida;
+ s->suggests = ido;
else if (id == SOLVABLE_ENHANCES)
- s->enhances = ida;
+ s->enhances = ido;
else if (id == SOLVABLE_FRESHENS)
- s->freshens = ida;
+ s->freshens = ido;
#if 0
printf("%s ->\n", id2str(pool, id));
- for (; *ida; ida++)
- printf(" %s\n", dep2str(pool, *ida));
+ for (; source->idarraydata[ido]; ido++)
+ printf(" %s\n", dep2str(pool, source->idarraydata[ido]));
#endif
break;
}
}
}
- if (idarraydatap > source->idarraydata + size_idarray)
- {
- fprintf(stderr, "idarray overflow\n");
- exit(1);
- }
-
xfree(idmap);
xfree(solvdata);
#include "source_solv.h"
static void
-printids(Pool *pool, char *kind, Id *ids)
+printids(Source *source, char *kind, Offset ido)
{
- Id id;
- if (!ids)
+ Pool *pool = source->pool;
+ Id id, *ids;
+ if (!ido)
return;
printf("%s:\n", kind);
+ ids = source->idarraydata + ido;
while((id = *ids++) != 0)
printf(" %s\n", dep2str(pool, id));
}
printf("\n");
printf("solvable %d:\n", i);
printf("name: %s %s %s\n", id2str(pool, s->name), id2str(pool, s->evr), id2str(pool, s->arch));
- printids(pool, "provides", s->provides);
- printids(pool, "obsoletes", s->obsoletes);
- printids(pool, "conflicts", s->conflicts);
- printids(pool, "requires", s->requires);
- printids(pool, "recommends", s->recommends);
- printids(pool, "suggests", s->suggests);
- printids(pool, "supplements", s->supplements);
- printids(pool, "enhances", s->enhances);
- printids(pool, "freshens", s->freshens);
+ printids(source, "provides", s->provides);
+ printids(source, "obsoletes", s->obsoletes);
+ printids(source, "conflicts", s->conflicts);
+ printids(source, "requires", s->requires);
+ printids(source, "recommends", s->recommends);
+ printids(source, "suggests", s->suggests);
+ printids(source, "supplements", s->supplements);
+ printids(source, "enhances", s->enhances);
+ printids(source, "freshens", s->freshens);
}
exit(0);
}
#include "source_solv.h"
#include "source_write.h"
-static void
-adjust (Id **val, Id * new_id, Source *source)
-{
- if (!*val)
- return;
- assert (source->idarraydata <= *val);
- assert (*val < source->idarraydata + source->idarraysize);
- *val = new_id + (*val - source->idarraydata);
-}
-
int
main(int argc, char **argv)
{
for (si = source->start; si < source->start + source->nsolvables; si++)
{
Solvable *s = pool->solvables + si;
- adjust (&s->provides, new_id + new_id_size, source);
- adjust (&s->obsoletes, new_id + new_id_size, source);
- adjust (&s->conflicts, new_id + new_id_size, source);
- adjust (&s->requires, new_id + new_id_size, source);
- adjust (&s->recommends, new_id + new_id_size, source);
- adjust (&s->suggests, new_id + new_id_size, source);
- adjust (&s->supplements, new_id + new_id_size, source);
- adjust (&s->enhances, new_id + new_id_size, source);
- adjust (&s->freshens, new_id + new_id_size, source);
+ if (s->provides)
+ s->provides += new_id_size;
+ if (s->obsoletes)
+ s->obsoletes += new_id_size;
+ if (s->conflicts)
+ s->conflicts += new_id_size;
+ if (s->requires)
+ s->requires += new_id_size;
+ if (s->recommends)
+ s->recommends += new_id_size;
+ if (s->suggests)
+ s->suggests+= new_id_size;
+ if (s->supplements)
+ s->supplements += new_id_size;
+ if (s->enhances)
+ s->enhances += new_id_size;
+ if (s->freshens)
+ s->freshens += new_id_size;
}
new_id_size += source->idarraysize;
if (i > 0)
solvable = pool->solvables + source->start;
for (i = 0; i < pd.pack; i++, solvable++)
{
- if (deps[i].provides)
- solvable->provides = source->idarraydata + deps[i].provides;
- if (deps[i].requires)
- solvable->requires = source->idarraydata + deps[i].requires;
- if (deps[i].conflicts)
- solvable->conflicts = source->idarraydata + deps[i].conflicts;
- if (deps[i].obsoletes)
- solvable->obsoletes = source->idarraydata + deps[i].obsoletes;
- if (deps[i].recommends)
- solvable->recommends = source->idarraydata + deps[i].recommends;
- if (deps[i].supplements)
- solvable->supplements = source->idarraydata + deps[i].supplements;
- if (deps[i].suggests)
- solvable->suggests = source->idarraydata + deps[i].suggests;
- if (deps[i].enhances)
- solvable->enhances = source->idarraydata + deps[i].enhances;
- if (deps[i].freshens)
- solvable->freshens = source->idarraydata + deps[i].freshens;
+ solvable->provides = deps[i].provides;
+ solvable->requires = deps[i].requires;
+ solvable->conflicts = deps[i].conflicts;
+ solvable->obsoletes = deps[i].obsoletes;
+ solvable->recommends = deps[i].recommends;
+ solvable->supplements = deps[i].supplements;
+ solvable->suggests = deps[i].suggests;
+ solvable->enhances = deps[i].enhances;
+ solvable->freshens = deps[i].freshens;
}
free(deps);
s = pool->solvables + source->start;
for (i = 0; i < pd.pack; i++, s++)
{
- if (deps[i].provides)
- s->provides = source->idarraydata + deps[i].provides;
- if (deps[i].requires)
- s->requires = source->idarraydata + deps[i].requires;
- if (deps[i].conflicts)
- s->conflicts = source->idarraydata + deps[i].conflicts;
- if (deps[i].obsoletes)
- s->obsoletes = source->idarraydata + deps[i].obsoletes;
- if (deps[i].recommends)
- s->recommends = source->idarraydata + deps[i].recommends;
- if (deps[i].supplements)
- s->supplements = source->idarraydata + deps[i].supplements;
- if (deps[i].suggests)
- s->suggests = source->idarraydata + deps[i].suggests;
- if (deps[i].enhances)
- s->enhances = source->idarraydata + deps[i].enhances;
- if (deps[i].freshens)
- s->freshens = source->idarraydata + deps[i].freshens;
+ s->provides = deps[i].provides;
+ s->requires = deps[i].requires;
+ s->conflicts = deps[i].conflicts;
+ s->obsoletes = deps[i].obsoletes;
+ s->recommends = deps[i].recommends;
+ s->supplements = deps[i].supplements;
+ s->suggests = deps[i].suggests;
+ s->enhances = deps[i].enhances;
+ s->freshens = deps[i].freshens;
}
free(deps);
free(pd.content);
return olddeps;
}
-static unsigned int
-copydeps(Pool *pool, Source *source, Id *from, Pool *frompool)
+static Offset
+copydeps(Pool *pool, Source *source, Offset fromoff, Source *fromsource)
{
int cc;
- Id id, *ida;
- unsigned int olddeps;
+ Id id, *ida, *from;
+ Offset ido;
+ Pool *frompool = fromsource->pool;
- if (!from)
+ if (!fromoff)
return 0;
+ from = fromsource->idarraydata + fromoff;
for (ida = from, cc = 0; *ida; ida++, cc++)
;
if (cc == 0)
return 0;
- olddeps = source_reserve_ids(source, 0, cc);
- ida = source->idarraydata + olddeps;
+ ido = source_reserve_ids(source, 0, cc);
+ ida = source->idarraydata + ido;
if (frompool && pool != frompool)
{
while (*from)
else
memcpy(ida, from, (cc + 1) * sizeof(Id));
source->idarraysize += cc + 1;
- return olddeps;
+ return ido;
}
if (r->arch)
s->arch = str2id(pool, id2str(ref->pool, r->arch), 1);
}
- deps[i].provides = copydeps(pool, source, r->provides, ref->pool);
- deps[i].requires = copydeps(pool, source, r->requires, ref->pool);
- deps[i].conflicts = copydeps(pool, source, r->conflicts, ref->pool);
- deps[i].obsoletes = copydeps(pool, source, r->obsoletes, ref->pool);
- deps[i].recommends = copydeps(pool, source, r->recommends, ref->pool);
- deps[i].suggests = copydeps(pool, source, r->suggests, ref->pool);
- deps[i].supplements = copydeps(pool, source, r->supplements, ref->pool);
- deps[i].enhances = copydeps(pool, source, r->enhances, ref->pool);
- deps[i].freshens = copydeps(pool, source, r->freshens, ref->pool);
+ deps[i].provides = copydeps(pool, source, r->provides, ref);
+ deps[i].requires = copydeps(pool, source, r->requires, ref);
+ deps[i].conflicts = copydeps(pool, source, r->conflicts, ref);
+ deps[i].obsoletes = copydeps(pool, source, r->obsoletes, ref);
+ deps[i].recommends = copydeps(pool, source, r->recommends, ref);
+ deps[i].suggests = copydeps(pool, source, r->suggests, ref);
+ deps[i].supplements = copydeps(pool, source, r->supplements, ref);
+ deps[i].enhances = copydeps(pool, source, r->enhances, ref);
+ deps[i].freshens = copydeps(pool, source, r->freshens, ref);
continue;
}
}
s = pool->solvables + source->start;
for (i = 0; i < nrpmids; i++, s++)
{
- if (deps[i].provides)
- s->provides = source->idarraydata + deps[i].provides;
- if (deps[i].requires)
- s->requires = source->idarraydata + deps[i].requires;
- if (deps[i].conflicts)
- s->conflicts = source->idarraydata + deps[i].conflicts;
- if (deps[i].obsoletes)
- s->obsoletes = source->idarraydata + deps[i].obsoletes;
- if (deps[i].recommends)
- s->recommends = source->idarraydata + deps[i].recommends;
- if (deps[i].supplements)
- s->supplements = source->idarraydata + deps[i].supplements;
- if (deps[i].suggests)
- s->suggests = source->idarraydata + deps[i].suggests;
- if (deps[i].enhances)
- s->enhances = source->idarraydata + deps[i].enhances;
- if (deps[i].freshens)
- s->freshens = source->idarraydata + deps[i].freshens;
+ s->provides = deps[i].provides;
+ s->requires = deps[i].requires;
+ s->conflicts = deps[i].conflicts;
+ s->obsoletes = deps[i].obsoletes;
+ s->recommends = deps[i].recommends;
+ s->supplements = deps[i].supplements;
+ s->suggests = deps[i].suggests;
+ s->enhances = deps[i].enhances;
+ s->freshens = deps[i].freshens;
}
free(deps);
if (db)
s = pool->solvables + source->start;
for (i = 0; i < pd.pack; i++, s++)
{
- if (deps[i].provides)
- s->provides = source->idarraydata + deps[i].provides;
- if (deps[i].requires)
- s->requires = source->idarraydata + deps[i].requires;
- if (deps[i].conflicts)
- s->conflicts = source->idarraydata + deps[i].conflicts;
- if (deps[i].obsoletes)
- s->obsoletes = source->idarraydata + deps[i].obsoletes;
- if (deps[i].recommends)
- s->recommends = source->idarraydata + deps[i].recommends;
- if (deps[i].supplements)
- s->supplements = source->idarraydata + deps[i].supplements;
- if (deps[i].suggests)
- s->suggests = source->idarraydata + deps[i].suggests;
- if (deps[i].enhances)
- s->enhances = source->idarraydata + deps[i].enhances;
- if (deps[i].freshens)
- s->freshens = source->idarraydata + deps[i].freshens;
+ s->provides = deps[i].provides;
+ s->requires = deps[i].requires;
+ s->conflicts = deps[i].conflicts;
+ s->obsoletes = deps[i].obsoletes;
+ s->recommends = deps[i].recommends;
+ s->supplements = deps[i].supplements;
+ s->suggests = deps[i].suggests;
+ s->enhances = deps[i].enhances;
+ s->freshens = deps[i].freshens;
}
free(deps);
free(pd.content);
s = pool->solvables + source->start;
for (i = 0; i < pack; i++, s++)
{
- if (deps[i].provides)
- s->provides = source->idarraydata + deps[i].provides;
- if (deps[i].requires)
- s->requires = source->idarraydata + deps[i].requires;
- if (deps[i].conflicts)
- s->conflicts = source->idarraydata + deps[i].conflicts;
- if (deps[i].obsoletes)
- s->obsoletes = source->idarraydata + deps[i].obsoletes;
- if (deps[i].recommends)
- s->recommends = source->idarraydata + deps[i].recommends;
- if (deps[i].supplements)
- s->supplements = source->idarraydata + deps[i].supplements;
- if (deps[i].suggests)
- s->suggests = source->idarraydata + deps[i].suggests;
- if (deps[i].enhances)
- s->enhances = source->idarraydata + deps[i].enhances;
- if (deps[i].freshens)
- s->freshens = source->idarraydata + deps[i].freshens;
+ s->provides = deps[i].provides;
+ s->requires = deps[i].requires;
+ s->conflicts = deps[i].conflicts;
+ s->obsoletes = deps[i].obsoletes;
+ s->recommends = deps[i].recommends;
+ s->supplements = deps[i].supplements;
+ s->suggests = deps[i].suggests;
+ s->enhances = deps[i].enhances;
+ s->freshens = deps[i].freshens;
}
free(deps);
if (pd.tmp)
Id id;
int n = 0;
- while ((id = *idarray++) != ID_NULL)
+ while ((id = *idarray++) != 0)
{
n++;
while (ISRELDEP(id))
int nstrings, nrels;
unsigned int sizeid;
Reldep *ran;
+ Id *idarraydata;
int idsizes[RPM_RPMDBID + 1];
int bits, bitmaps;
nsolvables = source->nsolvables;
sstart = pool->solvables + source->start;
+ idarraydata = source->idarraydata;
needid = (NeedId *)calloc(pool->nstrings + pool->nrels, sizeof(*needid));
needid[s->name].need++;
needid[s->arch].need++;
needid[s->evr].need++;
- idsizes[SOLVABLE_PROVIDES] += incneedid(pool, s->provides, needid);
- idsizes[SOLVABLE_REQUIRES] += incneedid(pool, s->requires, needid);
- idsizes[SOLVABLE_CONFLICTS] += incneedid(pool, s->conflicts, needid);
- idsizes[SOLVABLE_OBSOLETES] += incneedid(pool, s->obsoletes, needid);
- idsizes[SOLVABLE_RECOMMENDS] += incneedid(pool, s->recommends, needid);
- idsizes[SOLVABLE_SUGGESTS] += incneedid(pool, s->suggests, needid);
- idsizes[SOLVABLE_SUPPLEMENTS] += incneedid(pool, s->supplements, needid);
- idsizes[SOLVABLE_ENHANCES] += incneedid(pool, s->enhances, needid);
- idsizes[SOLVABLE_FRESHENS] += incneedid(pool, s->freshens, needid);
+ if (s->provides)
+ idsizes[SOLVABLE_PROVIDES] += incneedid(pool, idarraydata + s->provides, needid);
+ if (s->requires)
+ idsizes[SOLVABLE_REQUIRES] += incneedid(pool, idarraydata + s->requires, needid);
+ if (s->conflicts)
+ idsizes[SOLVABLE_CONFLICTS] += incneedid(pool, idarraydata + s->conflicts, needid);
+ if (s->obsoletes)
+ idsizes[SOLVABLE_OBSOLETES] += incneedid(pool, idarraydata + s->obsoletes, needid);
+ if (s->recommends)
+ idsizes[SOLVABLE_RECOMMENDS] += incneedid(pool, idarraydata + s->recommends, needid);
+ if (s->suggests)
+ idsizes[SOLVABLE_SUGGESTS] += incneedid(pool, idarraydata + s->suggests, needid);
+ if (s->supplements)
+ idsizes[SOLVABLE_SUPPLEMENTS] += incneedid(pool, idarraydata + s->supplements, needid);
+ if (s->enhances)
+ idsizes[SOLVABLE_ENHANCES] += incneedid(pool, idarraydata + s->enhances, needid);
+ if (s->freshens)
+ idsizes[SOLVABLE_FRESHENS] += incneedid(pool, idarraydata + s->freshens, needid);
}
idsizes[SOLVABLE_NAME] = 1;
needid[0].need = 0;
needid[pool->nstrings].need = 0;
for (i = 0; i < pool->nstrings + pool->nrels; i++)
- {
- needid[i].map = i;
- }
+ needid[i].map = i;
qsort(needid + 1, pool->nstrings - 1, sizeof(*needid), needid_cmp_need);
qsort(needid + pool->nstrings, pool->nrels, sizeof(*needid), needid_cmp_need);
nstrings = i;
for (i = 0; i < nstrings; i++)
- {
- needid[needid[i].map].need = i;
- }
+ needid[needid[i].map].need = i;
for (i = 0; i < pool->nrels; i++)
{
write_id(fp, needid[s->evr].need);
if (s->provides)
- write_idarray(fp, pool, needid, s->provides);
+ write_idarray(fp, pool, needid, idarraydata + s->provides);
if (s->obsoletes)
- write_idarray(fp, pool, needid, s->obsoletes);
+ write_idarray(fp, pool, needid, idarraydata + s->obsoletes);
if (s->conflicts)
- write_idarray(fp, pool, needid, s->conflicts);
+ write_idarray(fp, pool, needid, idarraydata + s->conflicts);
if (s->requires)
- write_idarray(fp, pool, needid, s->requires);
+ write_idarray(fp, pool, needid, idarraydata + s->requires);
if (s->recommends)
- write_idarray(fp, pool, needid, s->recommends);
+ write_idarray(fp, pool, needid, idarraydata + s->recommends);
if (s->suggests)
- write_idarray(fp, pool, needid, s->suggests);
+ write_idarray(fp, pool, needid, idarraydata + s->suggests);
if (s->supplements)
- write_idarray(fp, pool, needid, s->supplements);
+ write_idarray(fp, pool, needid, idarraydata + s->supplements);
if (s->enhances)
- write_idarray(fp, pool, needid, s->enhances);
+ write_idarray(fp, pool, needid, idarraydata + s->enhances);
if (s->freshens)
- write_idarray(fp, pool, needid, s->freshens);
+ write_idarray(fp, pool, needid, idarraydata + s->freshens);
if (source->rpmdbid)
write_u32(fp, source->rpmdbid[i]);
}