- no more freshens. R.I.P.
[platform/upstream/libsolv.git] / src / pool.c
index 967e4f6..d14c27f 100644 (file)
@@ -516,6 +516,22 @@ pool_addrelproviders(Pool *pool, Id d)
        }
       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)
        {
@@ -546,11 +562,19 @@ pool_addrelproviders(Pool *pool, Id d)
        }
       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;
@@ -883,8 +907,6 @@ pool_addfileprovides_ids(Pool *pool, Repo *installed, Id **idp)
         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);
@@ -1344,12 +1366,12 @@ void
 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;
@@ -1423,9 +1445,10 @@ pool_trivial_installable(Pool *pool, Repo *oldinstalled, Map *installedmap, Queu
          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)
            {
@@ -1453,6 +1476,7 @@ pool_trivial_installable(Pool *pool, Repo *oldinstalled, Map *installedmap, Queu
          if (p2)
            continue;
        }
+#endif
       if (m != map[p])
        {
           map[p] = m;