diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-29 19:16:04 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-29 19:16:04 +0300 |
commit | 7b05eef61f08f0f34266ac3af4ae22fc72dbc269 (patch) | |
tree | 43fe57eeb28cdb6819729d331af36005b33c5ad2 /src/database.c | |
parent | 2887e04cd7ea8fcc3e0815a11db6899d1c9535bf (diff) | |
download | apk-tools-7b05eef61f08f0f34266ac3af4ae22fc72dbc269.tar.gz apk-tools-7b05eef61f08f0f34266ac3af4ae22fc72dbc269.tar.bz2 apk-tools-7b05eef61f08f0f34266ac3af4ae22fc72dbc269.tar.xz apk-tools-7b05eef61f08f0f34266ac3af4ae22fc72dbc269.zip |
tar: make checksumming of inner files conditional
and force checksumming only when unpacking archive. otherwise
it's extra computation for nothing.
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/database.c b/src/database.c index 720b7b0..efa91b4 100644 --- a/src/database.c +++ b/src/database.c @@ -706,7 +706,8 @@ static int apk_db_read_state(struct apk_database *db, int flags) if (!(flags & APK_OPENF_NO_SCRIPTS)) { is = apk_istream_from_file("var/lib/apk/scripts.tar"); if (is != NULL) { - apk_tar_parse(is, apk_read_script_archive_entry, db); + apk_tar_parse(is, apk_read_script_archive_entry, db, + FALSE); } else { is = apk_istream_from_file("var/lib/apk/scripts"); if (is != NULL) @@ -1119,7 +1120,7 @@ int apk_cache_download(struct apk_database *db, struct apk_checksum *csum, apk_sign_ctx_init(&sctx, APK_SIGN_VERIFY, NULL); is = apk_bstream_gunzip_mpart(apk_bstream_from_file(tmp2), apk_sign_ctx_mpart_cb, &sctx); - r = apk_tar_parse(is, apk_sign_ctx_verify_tar, &sctx); + r = apk_tar_parse(is, apk_sign_ctx_verify_tar, &sctx, FALSE); is->close(is); apk_sign_ctx_free(&sctx); if (r != 0) { @@ -1224,7 +1225,7 @@ static int load_index(struct apk_database *db, struct apk_bstream *bs, ctx.found = 0; apk_sign_ctx_init(&ctx.sctx, APK_SIGN_VERIFY, NULL); is = apk_bstream_gunzip_mpart(bs, apk_sign_ctx_mpart_cb, &ctx.sctx); - r = apk_tar_parse(is, load_apkindex, &ctx); + r = apk_tar_parse(is, load_apkindex, &ctx, FALSE); is->close(is); apk_sign_ctx_free(&ctx.sctx); if (ctx.found == 0) @@ -1639,7 +1640,7 @@ static int apk_db_unpack_pkg(struct apk_database *db, }; apk_sign_ctx_init(&ctx.sctx, APK_SIGN_VERIFY_IDENTITY, &newpkg->csum); tar = apk_bstream_gunzip_mpart(bs, apk_sign_ctx_mpart_cb, &ctx.sctx); - r = apk_tar_parse(tar, apk_db_install_archive_entry, &ctx); + r = apk_tar_parse(tar, apk_db_install_archive_entry, &ctx, TRUE); apk_sign_ctx_free(&ctx.sctx); tar->close(tar); |