]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Make fixarray schema mismatches non-fatal
authorMichael Schroeder <mls@suse.de>
Thu, 10 Dec 2015 14:52:47 +0000 (15:52 +0100)
committerMichael Schroeder <mls@suse.de>
Thu, 10 Dec 2015 14:52:47 +0000 (15:52 +0100)
We just ignore all elements in that case.

src/repodata.c

index 0660684ebe431bf9967785532fb8f7ac77ddbe87..bff5a87d142953b4d8040216265a84838738bb24 100644 (file)
@@ -3126,29 +3126,30 @@ repodata_serialize_key(Repodata *data, struct extdata *newincore,
            sp = schema;
            kp = data->xattrs[-*ida];
            if (!kp)
-             continue;
+             continue;         /* ignore empty elements */
            num++;
-           for (;*kp; kp += 2)
+           for (; *kp; kp += 2)
              *sp++ = *kp;
            *sp = 0;
            if (!schemaid)
              schemaid = repodata_schema2id(data, schema, 1);
            else if (schemaid != repodata_schema2id(data, schema, 0))
              {
-               pool_debug(data->repo->pool, SOLV_FATAL, "repodata_serialize_key: fixarray substructs with different schemas\n");
-               exit(1);
+               pool_debug(data->repo->pool, SOLV_ERROR, "repodata_serialize_key: fixarray substructs with different schemas\n");
+               num = 0;
+               break;
              }
          }
+       data_addid(xd, num);
        if (!num)
          break;
-       data_addid(xd, num);
        data_addid(xd, schemaid);
        for (ida = data->attriddata + val; *ida; ida++)
          {
            Id *kp = data->xattrs[-*ida];
            if (!kp)
              continue;
-           for (;*kp; kp += 2)
+           for (; *kp; kp += 2)
              repodata_serialize_key(data, newincore, newvincore, schema, data->keys + *kp, kp[1]);
          }
        break;