diff options
author | Timo Teräs <timo.teras@iki.fi> | 2021-07-30 17:54:30 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2021-07-30 17:54:30 +0300 |
commit | d3e71bb406239a5205163f9d8b31c4a5cac6f097 (patch) | |
tree | f6f1c9269c21339263cba281d11d06aed165a6f3 | |
parent | f61eba06275e0339cfc1b844e515121ca8ba281a (diff) | |
download | apk-tools-d3e71bb406239a5205163f9d8b31c4a5cac6f097.tar.gz apk-tools-d3e71bb406239a5205163f9d8b31c4a5cac6f097.tar.bz2 apk-tools-d3e71bb406239a5205163f9d8b31c4a5cac6f097.tar.xz apk-tools-d3e71bb406239a5205163f9d8b31c4a5cac6f097.zip |
mkndx: support v3 packages
-rw-r--r-- | src/app_mkndx.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/app_mkndx.c b/src/app_mkndx.c index 6e485b5..b26c2ff 100644 --- a/src/app_mkndx.c +++ b/src/app_mkndx.c @@ -176,8 +176,22 @@ static int mkndx_parse_v2meta(struct apk_extract_ctx *ectx, struct apk_istream * return 0; } +static int mkndx_parse_v3meta(struct apk_extract_ctx *ectx, struct adb *db) +{ + struct mkndx_ctx *ctx = container_of(ectx, struct mkndx_ctx, ectx); + struct adb_obj obj; + + adb_r_rootobj(db, &obj, &schema_package); + + adb_val_t o = adb_wa_append(&ctx->pkgs, + adb_w_copy(&ctx->db, db, adb_ro_val(&obj, ADBI_PKG_PKGINFO))); + if (ADB_IS_ERROR(o)) return -ADB_VAL_VALUE(o); + return 0; +} + static const struct apk_extract_ops extract_ndxinfo_ops = { .v2meta = mkndx_parse_v2meta, + .v3meta = mkndx_parse_v3meta, }; static int mkndx_main(void *pctx, struct apk_ctx *ac, struct apk_string_array *args) |