diff options
author | Timo Teräs <timo.teras@iki.fi> | 2020-10-09 12:44:32 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-10-09 16:09:19 +0300 |
commit | a627ab8eb8387ebf5735cf525ae72bfa159aa39a (patch) | |
tree | 6c11a133c2743d03c4b4bc8be0f9cb42819aaee7 /src/app_info.c | |
parent | 354713d2f746c197eed6a1feb4c6af3420af6c15 (diff) | |
download | apk-tools-a627ab8eb8387ebf5735cf525ae72bfa159aa39a.tar.gz apk-tools-a627ab8eb8387ebf5735cf525ae72bfa159aa39a.tar.bz2 apk-tools-a627ab8eb8387ebf5735cf525ae72bfa159aa39a.tar.xz apk-tools-a627ab8eb8387ebf5735cf525ae72bfa159aa39a.zip |
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.
Diffstat (limited to 'src/app_info.c')
-rw-r--r-- | src/app_info.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/app_info.c b/src/app_info.c index 8f02f30..beb32d9 100644 --- a/src/app_info.c +++ b/src/app_info.c @@ -438,12 +438,14 @@ static int option_parse_applet(void *pctx, struct apk_ctx *ac, int opt, const ch return 0; } -static int info_main(void *ctx, struct apk_database *db, struct apk_string_array *args) +static int info_main(void *ctx, struct apk_ctx *ac, struct apk_string_array *args) { + struct apk_out *out = &ac->out; + struct apk_database *db = ac->db; struct info_ctx *ictx = (struct info_ctx *) ctx; struct apk_installed_package *ipkg; - verbosity = apk_out_verbosity(&db->ctx->out); + verbosity = apk_out_verbosity(out); ictx->db = db; if (ictx->subaction_mask == 0) ictx->subaction_mask = APK_INFO_DESC | APK_INFO_URL | APK_INFO_SIZE; |