]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Special case file dependencies in the testcase writer
authorMichael Schroeder <mls@suse.de>
Fri, 8 Apr 2022 11:43:39 +0000 (13:43 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 8 Apr 2022 11:43:39 +0000 (13:43 +0200)
There's special casing in the reader, so we have to make sure
that complex dependencies starting with a '/' are written
correctly.

ext/repo_testcase.c

index 38676efdde9feda08bbf446067d24ad18dd428ca..29dd8c0fe3cb8f4e35a1591fd89daea436bdc02c 100644 (file)
@@ -388,7 +388,13 @@ writedeps(Repo *repo, FILE *fp, const char *tag, Id key, Solvable *s, Offset off
          fprintf(fp, "+%s\n", tag);
          tagwritten = 1;
        }
-      fprintf(fp, "%s\n", idstr);
+      if (*idstr == '/' && !ISRELDEP(id)) {
+        fprintf(fp, "%s\n", pool_id2str(pool, id));
+      } else if (*idstr == '/') {
+        fprintf(fp, "\\2f%s\n", idstr + 1);
+      } else {
+        fprintf(fp, "%s\n", idstr);
+      }
     }
   if (tagwritten)
     fprintf(fp, "-%s\n", tag);