summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-02-24 15:50:39 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-02-24 16:31:40 +0200
commit99145e2c0dc0b5b3b5a2a72fb1bff140d1f583f3 (patch)
tree37eb5b28d99600d3b310e502218dbc8167adf986 /src/index.c
parent97d44b5a002b61c7b95303bb8616f1caa6556bca (diff)
downloadapk-tools-99145e2c0dc0b5b3b5a2a72fb1bff140d1f583f3.tar.gz
apk-tools-99145e2c0dc0b5b3b5a2a72fb1bff140d1f583f3.tar.bz2
apk-tools-99145e2c0dc0b5b3b5a2a72fb1bff140d1f583f3.tar.xz
apk-tools-99145e2c0dc0b5b3b5a2a72fb1bff140d1f583f3.zip
all: introduce apk_provides and use it in apk_name
in preparation for provides support. implements also some dependency satisfaction helper routines. ref #574.
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/index.c b/src/index.c
index a3573f9..8d62252 100644
--- a/src/index.c
+++ b/src/index.c
@@ -72,7 +72,7 @@ static int warn_if_no_providers(apk_hash_item item, void *ctx)
struct counts *counts = (struct counts *) ctx;
struct apk_name *name = (struct apk_name *) item;
- if (name->pkgs->num == 0) {
+ if (name->providers->num == 0) {
if (++counts->unsatisfied < 10) {
apk_warning("No provider for dependency '%s'",
name->name);
@@ -143,8 +143,10 @@ static int index_main(void *ctx, struct apk_database *db, int argc, char **argv)
if (name == NULL)
break;
- for (j = 0; j < name->pkgs->num; j++) {
- pkg = name->pkgs->item[j];
+ for (j = 0; j < name->providers->num; j++) {
+ pkg = name->providers->item[j].pkg;
+ if (pkg->name != name)
+ continue;
if (apk_blob_compare(bver, *pkg->version) != 0)
continue;
if (pkg->size != fi.size)