Imported Upstream version 0.7.27
[platform/upstream/libsolv.git] / ext / repo_testcase.c
index 5cc0327..cbdd42a 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);
@@ -480,9 +486,18 @@ testcase_write_testtags(Repo *repo, FILE *fp)
       tmp = solvable_lookup_str(s, SOLVABLE_BUILDVERSION);
       if (tmp)
         fprintf(fp, "=Bvr: %s\n", tmp);
+      if (solvable_lookup_idarray(s, SOLVABLE_TRACK_FEATURES, &q))
+       {
+         int i;
+         for (i = 0; i < q.count; i++)
+           fprintf(fp, "=Trf: %s\n", pool_id2str(pool, q.elements[i]));
+       }
       ti = solvable_lookup_num(s, SOLVABLE_BUILDTIME, 0);
       if (ti)
        fprintf(fp, "=Tim: %u\n", ti);
+      ti = solvable_lookup_num(s, SOLVABLE_INSTALLTIME, 0);
+      if (ti)
+       fprintf(fp, "=Itm: %u\n", ti);
       writefilelist(repo, fp, "Fls:", s);
     }
   queue_free(&q);
@@ -607,7 +622,7 @@ testcase_add_testtags(Repo *repo, FILE *fp, int flags)
          /* join back version and release */
          if (sp[2] && !(sp[2][0] == '-' && !sp[2][1]))
            sp[2][-1] = '-';
-         s->evr = makeevr(pool, sp[1]);
+         s->evr = pool_str2id(pool, sp[1], 1);
          s->arch = strcmp(sp[3], "-") ? pool_str2id(pool, sp[3], 1) : 0;
          continue;
        default:
@@ -629,6 +644,11 @@ testcase_add_testtags(Repo *repo, FILE *fp, int flags)
          if (t)
            repodata_set_num(data, s - pool->solvables, SOLVABLE_BUILDTIME, t);
          break;
+       case 'I' << 16 | 't' << 8 | 'm':
+         t = atoi(line + 6);
+         if (t)
+           repodata_set_num(data, s - pool->solvables, SOLVABLE_INSTALLTIME, t);
+         break;
        case 'R' << 16 | 'e' << 8 | 'q':
          s->requires = adddep(repo, s->requires, line + 6, -SOLVABLE_PREREQMARKER);
          break;
@@ -707,6 +727,9 @@ testcase_add_testtags(Repo *repo, FILE *fp, int flags)
        case 'B' << 16 | 'v' << 8 | 'r':
          repodata_set_str(data, s - pool->solvables, SOLVABLE_BUILDVERSION, line + 6);
          break;
+       case 'T' << 16 | 'r' << 8 | 'f':
+         repodata_add_poolstr_array(data, s - pool->solvables, SOLVABLE_TRACK_FEATURES, line + 6);
+         break;
         default:
          break;
         }