]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Support DISTTYPE_CONDA in dep2str()
authorMichael Schroeder <mls@suse.de>
Wed, 27 Mar 2019 12:16:53 +0000 (13:16 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 27 Mar 2019 12:16:53 +0000 (13:16 +0100)
This basically strips the spaces from the relops and uses ',' for
REL_WITH and '|' for REL_OR.

src/poolid.c

index 3b55f76455745ff88dfbbc7aa625dc13ff637038..1312ab9cf5cac27572423089a133b0b0db4a453b 100644 (file)
@@ -168,6 +168,20 @@ pool_id2rel(const Pool *pool, Id id)
   if (!ISRELDEP(id))
     return "";
   rd = GETRELDEP(pool, id);
+
+#ifdef ENABLE_CONDA
+  if (pool->disttype == DISTTYPE_CONDA)
+    {
+      static const char *condarels[] = { "!", ">", "=", ">=", "<", "!=", "<=", "<=>" };
+      if (rd->flags < 8)
+        return condarels[rd->flags];
+      if (rd->flags == REL_WITH)
+        return ",";
+      if (rd->flags == REL_OR)
+        return "|";
+    }
+#endif
+
   switch (rd->flags)
     {
     /* debian special cases < and > */