From 2345548e4522a988024426432d0ed0e421599eba Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Tue, 21 Jul 2009 17:59:08 +0300 Subject: index: read also new style index files --- src/index.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/index.c') diff --git a/src/index.c b/src/index.c index 2a7365e..608dea8 100644 --- a/src/index.c +++ b/src/index.c @@ -51,20 +51,15 @@ static int index_parse(void *ctx, int optch, int optindex, const char *optarg) static int index_read_file(struct apk_database *db, struct index_ctx *ictx) { - struct apk_bstream *bs; struct apk_file_info fi; - int r; + if (ictx->index == NULL) return 0; if (apk_file_get_info(ictx->index, APK_CHECKSUM_NONE, &fi) < 0) return -1; ictx->index_mtime = fi.mtime; - bs = apk_bstream_from_istream(apk_bstream_gunzip(apk_bstream_from_url(ictx->index))); - if (bs == NULL) - return -1; - r = apk_db_index_read(db, bs, 0); - bs->close(bs, NULL); - return r; + + return apk_db_index_read_file(db, ictx->index, 0); } static int warn_if_no_providers(apk_hash_item item, void *ctx) -- cgit v1.2.3-60-g2f50