From a627ab8eb8387ebf5735cf525ae72bfa159aa39a Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Fri, 9 Oct 2020 12:44:32 +0300 Subject: make apk_database optional for applets that don't need it The new v3 applets don't use it, and eventually all applets will use the new formats only. This prepares the code for this, and moves trust, id_cache, and root_fd to apk_ctx which is enough for v3 applets at this time. The generic code is made to not initialize apk_database if it's not needed. --- src/app_audit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/app_audit.c') diff --git a/src/app_audit.c b/src/app_audit.c index acfca13..2d4925d 100644 --- a/src/app_audit.c +++ b/src/app_audit.c @@ -307,9 +307,10 @@ static int audit_missing_files(apk_hash_item item, void *pctx) return 0; } -static int audit_main(void *ctx, struct apk_database *db, struct apk_string_array *args) +static int audit_main(void *ctx, struct apk_ctx *ac, struct apk_string_array *args) { - struct apk_out *out = &db->ctx->out; + struct apk_out *out = &ac->out; + struct apk_database *db = ac->db; struct audit_tree_ctx atctx; struct audit_ctx *actx = (struct audit_ctx *) ctx; char **parg, *arg; -- cgit v1.2.3-70-g09d2