Store the susetags datadir as an attribute to the product solvable
authorMichael Matz <matz@suse.de>
Mon, 10 Mar 2008 15:01:05 +0000 (15:01 +0000)
committerMichael Matz <matz@suse.de>
Mon, 10 Mar 2008 15:01:05 +0000 (15:01 +0000)
(key "susetags:datadir").

tools/repo_content.c
tools/repo_susetags.c

index 7706750..3a47e20 100644 (file)
@@ -249,6 +249,8 @@ repo_add_content(Repo *repo, FILE *fp)
            s->supplements = adddep(pool, &pd, s->supplements, value, 0);
          else if (istag ("ENHANCES"))
            s->enhances = adddep(pool, &pd, s->enhances, value, 0);
+         else if (istag ("DATADIR"))
+           repo_set_str(repo, s - pool->solvables, str2id(pool, "susetags:datadir", 1), value);
          /* FRESHENS doesn't seem to exist.  */
          /* XXX do something about LINGUAS and ARCH? */
 #undef istag
index 2c7468c..0f785c4 100644 (file)
@@ -432,12 +432,11 @@ repo_add_susetags(Repo *repo, FILE *fp, Id vendor, const char *language, int fla
   Repodata *data = 0;
 
   if ((flags & SUSETAGS_EXTEND) && repo->nrepodata)
-    {
-      /* use last repodata */
-      data = repo->repodata + repo->nrepodata - 1;
-      indesc = 1;
-    }
-  if (!data)
+    indesc = 1;
+  if (repo->nrepodata)
+    /* use last repodata */
+    data = repo->repodata + repo->nrepodata - 1;
+  else
     data = repo_add_repodata(repo, 0);
 
   memset(&pd, 0, sizeof(pd));