]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Move pool_dep_fulfilled_in_map into pooldep.c
authorMichael Schroeder <mls@suse.de>
Wed, 30 Jul 2025 10:40:59 +0000 (12:40 +0200)
committerMichael Schroeder <mls@suse.de>
Wed, 30 Jul 2025 10:40:59 +0000 (12:40 +0200)
src/pool.c
src/pooldep.c

index fa5f801dc5f5a52548d257e0ac9f5100599e38c7..3be2e444b93075dc7af9325f02db99fdde89052f 100644 (file)
@@ -754,74 +754,4 @@ int (*pool_get_custom_vendorcheck(Pool *pool))(Pool *, Solvable *, Solvable *)
   return pool->custom_vendorcheck;
 }
 
-static int
-pool_dep_fulfilled_in_map_cplx(Pool *pool, const Map *map, Reldep *rd)
-{
-  if (rd->flags == REL_COND)
-    {
-      if (ISRELDEP(rd->evr))
-       {
-         Reldep *rd2 = GETRELDEP(pool, rd->evr);
-         if (rd2->flags == REL_ELSE)
-           {
-             if (pool_dep_fulfilled_in_map(pool, map, rd2->name))
-               return pool_dep_fulfilled_in_map(pool, map, rd->name);
-             return pool_dep_fulfilled_in_map(pool, map, rd2->evr);
-           }
-       }
-      if (pool_dep_fulfilled_in_map(pool, map, rd->name))
-       return 1;
-      return !pool_dep_fulfilled_in_map(pool, map, rd->evr);
-    }
-  if (rd->flags == REL_UNLESS)
-    {
-      if (ISRELDEP(rd->evr))
-       {
-         Reldep *rd2 = GETRELDEP(pool, rd->evr);
-         if (rd2->flags == REL_ELSE)
-           {
-             if (!pool_dep_fulfilled_in_map(pool, map, rd2->name))
-               return pool_dep_fulfilled_in_map(pool, map, rd->name);
-             return pool_dep_fulfilled_in_map(pool, map, rd2->evr);
-           }
-       }
-      if (!pool_dep_fulfilled_in_map(pool, map, rd->name))
-       return 0;
-      return !pool_dep_fulfilled_in_map(pool, map, rd->evr);
-    }
-  if (rd->flags == REL_AND)
-    {
-      if (!pool_dep_fulfilled_in_map(pool, map, rd->name))
-       return 0;
-      return pool_dep_fulfilled_in_map(pool, map, rd->evr);
-    }
-  if (rd->flags == REL_OR)
-    {
-      if (pool_dep_fulfilled_in_map(pool, map, rd->name))
-       return 1;
-      return pool_dep_fulfilled_in_map(pool, map, rd->evr);
-    }
-  return 0;
-}
-
-
-int pool_dep_fulfilled_in_map(Pool *pool, const Map *map, Id dep)
-{
-  Id p, pp;
-
-  if (ISRELDEP(dep)) {
-    Reldep *rd = GETRELDEP(pool, dep);
-    if (rd->flags == REL_COND || rd->flags == REL_UNLESS ||
-        rd->flags == REL_AND || rd->flags == REL_OR)
-      return pool_dep_fulfilled_in_map_cplx(pool, map, rd);
-    if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES)
-      return 0;
-  }
-  FOR_PROVIDES(p, pp, dep) {
-    if (MAPTST(map, p))
-      return 1;
-  }
-  return 0;
-}
-
 /* EOF */
index d397c28da385cd3541ef3dc4910d4feeff0b1626..e7ff68c84a59057969b0621fbb3e3bd11d9f436b 100644 (file)
@@ -345,4 +345,73 @@ pool_whatmatchessolvable(Pool *pool, Id keyname, Id solvid, Queue *q, int marker
   queue_free(&qq);
 }
 
+static int
+pool_dep_fulfilled_in_map_cplx(Pool *pool, const Map *map, Reldep *rd)
+{
+  if (rd->flags == REL_COND)
+    {
+      if (ISRELDEP(rd->evr))
+       {
+         Reldep *rd2 = GETRELDEP(pool, rd->evr);
+         if (rd2->flags == REL_ELSE)
+           {
+             if (pool_dep_fulfilled_in_map(pool, map, rd2->name))
+               return pool_dep_fulfilled_in_map(pool, map, rd->name);
+             return pool_dep_fulfilled_in_map(pool, map, rd2->evr);
+           }
+       }
+      if (pool_dep_fulfilled_in_map(pool, map, rd->name))
+       return 1;
+      return !pool_dep_fulfilled_in_map(pool, map, rd->evr);
+    }
+  if (rd->flags == REL_UNLESS)
+    {
+      if (ISRELDEP(rd->evr))
+       {
+         Reldep *rd2 = GETRELDEP(pool, rd->evr);
+         if (rd2->flags == REL_ELSE)
+           {
+             if (!pool_dep_fulfilled_in_map(pool, map, rd2->name))
+               return pool_dep_fulfilled_in_map(pool, map, rd->name);
+             return pool_dep_fulfilled_in_map(pool, map, rd2->evr);
+           }
+       }
+      if (!pool_dep_fulfilled_in_map(pool, map, rd->name))
+       return 0;
+      return !pool_dep_fulfilled_in_map(pool, map, rd->evr);
+    }
+  if (rd->flags == REL_AND)
+    {
+      if (!pool_dep_fulfilled_in_map(pool, map, rd->name))
+       return 0;
+      return pool_dep_fulfilled_in_map(pool, map, rd->evr);
+    }
+  if (rd->flags == REL_OR)
+    {
+      if (pool_dep_fulfilled_in_map(pool, map, rd->name))
+       return 1;
+      return pool_dep_fulfilled_in_map(pool, map, rd->evr);
+    }
+  return 0;
+}
+
+int
+pool_dep_fulfilled_in_map(Pool *pool, const Map *map, Id dep)
+{
+  Id p, pp;
+
+  if (ISRELDEP(dep)) {
+    Reldep *rd = GETRELDEP(pool, dep);
+    if (rd->flags == REL_COND || rd->flags == REL_UNLESS ||
+        rd->flags == REL_AND || rd->flags == REL_OR)
+      return pool_dep_fulfilled_in_map_cplx(pool, map, rd);
+    if (rd->flags == REL_NAMESPACE && rd->name == NAMESPACE_SPLITPROVIDES)
+      return 0;
+  }
+  FOR_PROVIDES(p, pp, dep) {
+    if (MAPTST(map, p))
+      return 1;
+  }
+  return 0;
+}
 /* EOF */