- be more backward compatible
authorMichael Schroeder <mls@suse.de>
Wed, 15 Jul 2009 12:04:42 +0000 (14:04 +0200)
committerMichael Schroeder <mls@suse.de>
Wed, 15 Jul 2009 12:04:42 +0000 (14:04 +0200)
ext/repo_susetags.c

index e73afede6d2960d039c42a89cbc9007d8a4901db..db4a590d8a078d51652f9733cd096e1b1c8db87a 100644 (file)
@@ -637,19 +637,7 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
          s = 0;
           freshens = 0;
 
-         if (!joinhash)
-           {
-             /* normal operation. create a new solvable. */
-             s = pool_id2solvable(pool, repo_add_solvable(repo));
-             if (pd.kind)
-               s->name = str2id(pool, join2(pd.kind, ":", sp[0]), 1);
-             else
-               s->name = str2id(pool, sp[0], 1);
-             s->evr = makeevr(pool, join2(sp[1], "-", sp[2]));
-             s->arch = str2id(pool, sp[3], 1);
-             s->vendor = defvendor;
-           }
-         else
+         if (joinhash)
            {
              /* data join operation. find solvable matching name/arch/evr and
                * add data to it */
@@ -661,19 +649,34 @@ repo_add_susetags(Repo *repo, FILE *fp, Id defvendor, const char *language, int
                name = str2id(pool, sp[0], 0);
              evr = makeevr(pool, join2(sp[1], "-", sp[2]));
              arch = str2id(pool, sp[3], 0);
-             if (!name || !arch)
-               continue;       /* ids didn't exist */
-             if (repo->start + last_found_pack + 1 < repo->end)
+             if (name && arch)
                {
-                 s = pool->solvables + repo->start + last_found_pack + 1;
-                 if (s->repo != repo || s->name != name || s->evr != evr || s->arch != arch)
-                   s = 0;
+                 if (repo->start + last_found_pack + 1 < repo->end)
+                   {
+                     s = pool->solvables + repo->start + last_found_pack + 1;
+                     if (s->repo != repo || s->name != name || s->evr != evr || s->arch != arch)
+                       s = 0;
+                   }
+                 if (!s)
+                   s = joinhash_lookup(repo, joinhash, joinhashm, name, evr, arch);
                }
-             if (!s)
-               s = joinhash_lookup(repo, joinhash, joinhashm, name, evr, arch);
-             if (!s)
+             if (!s && (flags & REPO_EXTEND_SOLVABLES) != 0)
                continue;
+             /* fallthrough to package creation */
            }
+         if (!s)
+           {
+             /* normal operation. create a new solvable. */
+             s = pool_id2solvable(pool, repo_add_solvable(repo));
+             if (pd.kind)
+               s->name = str2id(pool, join2(pd.kind, ":", sp[0]), 1);
+             else
+               s->name = str2id(pool, sp[0], 1);
+             s->evr = makeevr(pool, join2(sp[1], "-", sp[2]));
+             s->arch = str2id(pool, sp[3], 1);
+             s->vendor = defvendor;
+           }
+         else
          last_found_pack = (s - pool->solvables) - repo->start;
          if (data)
            handle = s - pool->solvables;