}
break;
case REL_ARCH:
+ /* small hack: make it possible to match <pkg>.src
+ * we have to iterate over the solvables as src packages do not
+ * provide anything, thus they are not indexed in our
+ * whatprovides hash */
+ if (evr == ARCH_SRC)
+ {
+ Solvable *s;
+ for (p = 1, s = pool->solvables + p; p < pool->nsolvables; p++, s++)
+ {
+ if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
+ continue;
+ if (pool_match_nevr(pool, s, name))
+ queue_push(&plist, p);
+ }
+ break;
+ }
pp = pp2 = pool_whatprovides(pool, name);
while ((p = *pp++) != 0)
{
}
while ((p = *pp++) != 0)
{
+ Solvable *s = pool->solvables + p;
#if 0
- POOL_DEBUG(DEBUG_1, "addrelproviders: checking package %s\n", id2str(pool, pool->p[p].name));
+ POOL_DEBUG(DEBUG_1, "addrelproviders: checking package %s\n", id2str(pool, s->name));
#endif
+ if (!s->provides)
+ {
+ /* no provides - check nevr */
+ if (pool_match_nevr_rel(pool, s, MAKERELDEP(d)))
+ queue_push(&plist, p);
+ continue;
+ }
/* solvable p provides name in some rels */
- pidp = pool->solvables[p].repo->idarraydata + pool->solvables[p].provides;
+ pidp = s->repo->idarraydata + s->provides;
while ((pid = *pidp++) != 0)
{
int pflags;
pool_addfileprovides_dep(pool, repo->idarraydata + s->supplements, &sf, isfp);
if (s->enhances)
pool_addfileprovides_dep(pool, repo->idarraydata + s->enhances, &sf, isfp);
- if (s->freshens)
- pool_addfileprovides_dep(pool, repo->idarraydata + s->freshens, &sf, isfp);
}
map_free(&sf.seen);
map_free(&isf.seen);
pool->languages[i] = strdup(languages[i]);
}
+Id
+pool_id2langid(Pool *pool, Id id, const char *lang, int create)
+{
+ const char *n;
+ char buf[256], *p;
+ int l;
+
+ if (!lang)
+ return id;
+ n = id2str(pool, id);
+ l = strlen(n) + strlen(lang) + 2;
+ if (l > sizeof(buf))
+ p = sat_malloc(strlen(n) + strlen(lang) + 2);
+ else
+ p = buf;
+ sprintf(p, "%s:%s", n, lang);
+ id = str2id(pool, p, create);
+ if (p != buf)
+ free(p);
+ return id;
+}
+
char *
pool_alloctmpspace(Pool *pool, int len)
{
pool_trivial_installable(Pool *pool, Repo *oldinstalled, Map *installedmap, Queue *pkgs, Queue *res)
{
int i, r, m, did;
- Id p, *dp, con, *conp, req, *reqp, obs, *obsp, *pp;
+ Id p, *dp, con, *conp, req, *reqp;
unsigned char *map;
Solvable *s;
map = sat_calloc(pool->nsolvables, 1);
- for (p = 0; p < pool->nsolvables; p++)
+ for (p = 1; p < pool->nsolvables; p++)
{
if (!MAPTST(installedmap, p))
continue;
if (con)
continue; /* found a conflict */
}
+#if 0
if (s->repo && s->repo != oldinstalled)
{
- Id p2;
+ Id p2, obs, *obsp, *pp;
Solvable *s2;
if (s->obsoletes)
{
if (p2)
continue;
}
+#endif
if (m != map[p])
{
map[p] = m;