From 99145e2c0dc0b5b3b5a2a72fb1bff140d1f583f3 Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Fri, 24 Feb 2012 15:50:39 +0200 Subject: all: introduce apk_provides and use it in apk_name in preparation for provides support. implements also some dependency satisfaction helper routines. ref #574. --- src/fix.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/fix.c') diff --git a/src/fix.c b/src/fix.c index d63006a..ba39d51 100644 --- a/src/fix.c +++ b/src/fix.c @@ -59,7 +59,7 @@ static int fix_main(void *pctx, struct apk_database *db, int argc, char **argv) struct fix_ctx *ctx = (struct fix_ctx *) pctx; struct apk_name *name; struct apk_package *pkg; - int r = 0, i, j; + int r = 0, i; if (!ctx->solver_flags) ctx->solver_flags = APK_SOLVERF_REINSTALL; @@ -83,12 +83,7 @@ static int fix_main(void *pctx, struct apk_database *db, int argc, char **argv) name = pkg->name; } else { name = apk_db_get_name(db, APK_BLOB_STR(argv[i])); - for (j = 0; j < name->pkgs->num; j++) { - if (name->pkgs->item[j]->ipkg != NULL) { - pkg = name->pkgs->item[j]; - break; - } - } + pkg = apk_pkg_get_installed(name); } if (pkg == NULL || pkg->ipkg == NULL) { apk_error("%s is not installed", name->name); -- cgit v1.2.3-60-g2f50