db: fix usage of apk_name_array in install_ctx
got broken to the previous array cleanup and grepping struct definition only from headers.cute-signatures
parent
7be853e637
commit
f85d87e5f9
|
@ -1753,10 +1753,10 @@ static int apk_db_install_archive_entry(void *_ctx,
|
||||||
if (opkg->name == pkg->name)
|
if (opkg->name == pkg->name)
|
||||||
break;
|
break;
|
||||||
/* Overwriting with permission? */
|
/* Overwriting with permission? */
|
||||||
for (i = 0; ctx->replaces && i < ctx->replaces->num; i++)
|
for (i = 0; i < ctx->replaces->num; i++)
|
||||||
if (opkg->name == ctx->replaces->item[i])
|
if (opkg->name == ctx->replaces->item[i])
|
||||||
break;
|
break;
|
||||||
if (ctx->replaces && i < ctx->replaces->num)
|
if (i < ctx->replaces->num)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!(apk_flags & APK_FORCE)) {
|
if (!(apk_flags & APK_FORCE)) {
|
||||||
|
@ -2027,13 +2027,13 @@ static int apk_db_unpack_pkg(struct apk_database *db,
|
||||||
.cb = cb,
|
.cb = cb,
|
||||||
.cb_ctx = cb_ctx,
|
.cb_ctx = cb_ctx,
|
||||||
};
|
};
|
||||||
|
apk_name_array_init(&ctx.replaces);
|
||||||
apk_sign_ctx_init(&ctx.sctx, APK_SIGN_VERIFY_IDENTITY, &pkg->csum, db->keys_fd);
|
apk_sign_ctx_init(&ctx.sctx, APK_SIGN_VERIFY_IDENTITY, &pkg->csum, db->keys_fd);
|
||||||
tar = apk_bstream_gunzip_mpart(bs, apk_sign_ctx_mpart_cb, &ctx.sctx);
|
tar = apk_bstream_gunzip_mpart(bs, apk_sign_ctx_mpart_cb, &ctx.sctx);
|
||||||
r = apk_tar_parse(tar, apk_db_install_archive_entry, &ctx, TRUE);
|
r = apk_tar_parse(tar, apk_db_install_archive_entry, &ctx, TRUE);
|
||||||
apk_sign_ctx_free(&ctx.sctx);
|
apk_sign_ctx_free(&ctx.sctx);
|
||||||
|
apk_name_array_free(&ctx.replaces);
|
||||||
tar->close(tar);
|
tar->close(tar);
|
||||||
if (ctx.replaces)
|
|
||||||
free(ctx.replaces);
|
|
||||||
|
|
||||||
if (need_copy) {
|
if (need_copy) {
|
||||||
if (r == 0)
|
if (r == 0)
|
||||||
|
|
Loading…
Reference in New Issue