From 1b5422fb4af4bb836d15e07c86128507147315d0 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Fri, 16 Jan 2009 15:14:23 +0200 Subject: index: write out only packages specified in command line Ignore /etc/apk/repositories, so additional repositories that depend on other repositories need to have explicit --repository reference on command line when generating the index (to avoid warnings). --- src/index.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/index.c') diff --git a/src/index.c b/src/index.c index 81adc51..c272b74 100644 --- a/src/index.c +++ b/src/index.c @@ -16,7 +16,6 @@ #include "apk_database.h" struct counts { - int total; int unsatisfied; }; @@ -34,7 +33,6 @@ static int warn_if_no_providers(apk_hash_item item, void *ctx) "not reporting the rest."); } } - counts->total++; return 0; } @@ -42,16 +40,16 @@ static int warn_if_no_providers(apk_hash_item item, void *ctx) static int index_main(void *ctx, int argc, char **argv) { struct apk_database db; - struct counts counts = {0,0}; + struct counts counts = {0}; struct apk_ostream *os; - int i; + int total, i; apk_db_open(&db, NULL); for (i = 0; i < argc; i++) apk_db_pkg_add_file(&db, argv[i]); os = apk_ostream_to_fd(STDOUT_FILENO); - apk_db_index_write(&db, os); + total = apk_db_index_write(&db, os); os->close(os); apk_hash_foreach(&db.available.names, warn_if_no_providers, &counts); @@ -61,7 +59,7 @@ static int index_main(void *ctx, int argc, char **argv) apk_warning("Total of %d unsatisfiable package " "names. Your repository maybe broken.", counts.unsatisfied); - apk_message("Index has %d packages", counts.total); + apk_message("Index has %d packages", total); return 0; } -- cgit v1.2.3-60-g2f50