From: Michael Schroeder Date: Wed, 19 Sep 2018 11:54:53 +0000 (+0200) Subject: Support reading of TYPE_DELETED keys X-Git-Tag: 0.7.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c07a3fe140493dcb725a050451d4e08105fc7eb;p=thirdparty%2Flibsolv.git Support reading of TYPE_DELETED keys --- diff --git a/src/repo_solv.c b/src/repo_solv.c index feb7f33e..a945a8f0 100644 --- a/src/repo_solv.c +++ b/src/repo_solv.c @@ -859,7 +859,7 @@ repo_add_solv(Repo *repo, FILE *fp, int flags) type = idmap[type]; else if ((flags & REPO_LOCALPOOL) != 0) type = pool_str2id(pool, stringpool_id2str(spool, type), 1); - if (type < REPOKEY_TYPE_VOID || type > REPOKEY_TYPE_FLEXARRAY) + if (type < REPOKEY_TYPE_VOID || type > REPOKEY_TYPE_DELETED) { data.error = pool_error(pool, SOLV_ERROR_UNSUPPORTED, "unsupported data type '%s'", pool_id2str(pool, type)); type = REPOKEY_TYPE_VOID; diff --git a/src/repo_write.c b/src/repo_write.c index 9de1646b..4597b7dd 100644 --- a/src/repo_write.c +++ b/src/repo_write.c @@ -773,6 +773,7 @@ collect_data_cb(void *vcbdata, Solvable *s, Repodata *data, Repokey *key, KeyVal xd = cbdata->extdata + 0; /* incore buffer */ switch(key->type) { + case REPOKEY_TYPE_DELETED: case REPOKEY_TYPE_VOID: case REPOKEY_TYPE_CONSTANT: case REPOKEY_TYPE_CONSTANTID: diff --git a/src/repopack.h b/src/repopack.h index b76ae718..c7663a64 100644 --- a/src/repopack.h +++ b/src/repopack.h @@ -144,6 +144,7 @@ data_fetch(unsigned char *dp, KeyValue *kv, Repokey *key) switch (key->type) { case REPOKEY_TYPE_VOID: + case REPOKEY_TYPE_DELETED: return dp; case REPOKEY_TYPE_CONSTANT: kv->num2 = 0; diff --git a/tools/common_write.c b/tools/common_write.c index eb012afc..36f8dd89 100644 --- a/tools/common_write.c +++ b/tools/common_write.c @@ -58,7 +58,7 @@ tool_write(Repo *repo, FILE *fp) repowriter_set_keyfilter(writer, keyfilter_solv, 0); if (repowriter_write(writer, fp) != 0) { - fprintf(stderr, "repo write failed\n"); + fprintf(stderr, "repo write failed: %s\n", pool_errstr(repo->pool)); exit(1); } if (fflush(fp))