summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-16 13:18:47 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-16 13:18:47 +0000
commit61341384b338e4591eba1c3caa823b0582f47259 (patch)
tree5be9876b17b7ffe15928d874bb6072b88d8cc73e /src/index.c
parent500778f45e72ab66d9a8a5428ef06544303e3d17 (diff)
parent1b5422fb4af4bb836d15e07c86128507147315d0 (diff)
downloadapk-tools-61341384b338e4591eba1c3caa823b0582f47259.tar.gz
apk-tools-61341384b338e4591eba1c3caa823b0582f47259.tar.bz2
apk-tools-61341384b338e4591eba1c3caa823b0582f47259.tar.xz
apk-tools-61341384b338e4591eba1c3caa823b0582f47259.zip
Merge branch 'master' of ssh://dev.alpinelinux.org/gitroot/apk-tools
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c10
1 files changed, 4 insertions, 6 deletions
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;
}