diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-09-03 14:56:24 +0400 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-09-03 14:56:24 +0400 |
commit | 58e771303c95f9d97d009602516b509866c3fb5a (patch) | |
tree | 9cf8ce0d4608d4531850177549cb70670544fbb4 /src/database.c | |
parent | 7829f1191f1812f30c763a685dff1b61393f7491 (diff) | |
download | apk-tools-58e771303c95f9d97d009602516b509866c3fb5a.tar.gz apk-tools-58e771303c95f9d97d009602516b509866c3fb5a.tar.bz2 apk-tools-58e771303c95f9d97d009602516b509866c3fb5a.tar.xz apk-tools-58e771303c95f9d97d009602516b509866c3fb5a.zip |
index, version: support for repository descriptions (fixes #141)
ability embed description information to repository indexes
(e.g. repository name and version) and show it via "apk version -I".
Diffstat (limited to 'src/database.c')
-rw-r--r-- | src/database.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/database.c b/src/database.c index 5673c3c..16f8bb8 100644 --- a/src/database.c +++ b/src/database.c @@ -1399,17 +1399,21 @@ static int load_apkindex(void *sctx, const struct apk_file_info *fi, { struct apkindex_ctx *ctx = (struct apkindex_ctx *) sctx; struct apk_bstream *bs; + struct apk_repository *repo; if (apk_sign_ctx_process_file(&ctx->sctx, fi, is) == 0) return 0; - if (strcmp(fi->name, "APKINDEX") != 0) - return 0; + repo = &ctx->db->repos[ctx->repo]; - ctx->found = 1; - bs = apk_bstream_from_istream(is); - apk_db_index_read(ctx->db, bs, ctx->repo); - bs->close(bs, NULL); + if (strcmp(fi->name, "DESCRIPTION") == 0) { + repo->description = apk_blob_from_istream(is, fi->size); + } else if (strcmp(fi->name, "APKINDEX") == 0) { + ctx->found = 1; + bs = apk_bstream_from_istream(is); + apk_db_index_read(ctx->db, bs, ctx->repo); + bs->close(bs, NULL); + } return 0; } |