diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-08-04 16:54:15 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-08-04 16:54:15 +0300 |
commit | a602c49b31e92466ea42e2968833d3e6908a18c1 (patch) | |
tree | 2bce5d16480375e3a7c96c4646b11a5b11cf8035 /src/package.c | |
parent | 1fea5639b455ae4267a7dc17ef19b8d2506978b0 (diff) | |
download | apk-tools-a602c49b31e92466ea42e2968833d3e6908a18c1.tar.gz apk-tools-a602c49b31e92466ea42e2968833d3e6908a18c1.tar.bz2 apk-tools-a602c49b31e92466ea42e2968833d3e6908a18c1.tar.xz apk-tools-a602c49b31e92466ea42e2968833d3e6908a18c1.zip |
db: support "replaces" directive (fixes #113)
it will allow to overwrite files owned by some other packages
to get upgrades right (e.g. when splitting or renaming packages)
Diffstat (limited to 'src/package.c')
-rw-r--r-- | src/package.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/package.c b/src/package.c index 152edf6..43018d7 100644 --- a/src/package.c +++ b/src/package.c @@ -415,7 +415,7 @@ int apk_sign_ctx_process_file(struct apk_sign_ctx *ctx, return 0; } -static int read_datahash(void *ctx, apk_blob_t line) +int apk_sign_ctx_parse_pkginfo_line(void *ctx, apk_blob_t line) { struct apk_sign_ctx *sctx = (struct apk_sign_ctx *) ctx; apk_blob_t l, r; @@ -448,7 +448,9 @@ int apk_sign_ctx_verify_tar(void *sctx, const struct apk_file_info *fi, if (strcmp(fi->name, ".PKGINFO") == 0) { apk_blob_t blob = apk_blob_from_istream(is, fi->size); - apk_blob_for_each_segment(blob, "\n", read_datahash, ctx); + apk_blob_for_each_segment( + blob, "\n", + apk_sign_ctx_parse_pkginfo_line, ctx); free(blob.ptr); } @@ -628,15 +630,7 @@ static int read_info_line(void *ctx, apk_blob_t line) return 0; } } - - if (ri->sctx->data_started == 0 && - apk_blob_compare(APK_BLOB_STR("datahash"), l) == 0) { - ri->sctx->has_data_checksum = 1; - ri->sctx->md = EVP_sha256(); - apk_blob_pull_hexdump( - &r, APK_BLOB_PTR_LEN(ri->sctx->data_checksum, - EVP_MD_size(ri->sctx->md))); - } + apk_sign_ctx_parse_pkginfo_line(ri->sctx, line); return 0; } |