diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-02-24 15:50:39 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-02-24 16:31:40 +0200 |
commit | 99145e2c0dc0b5b3b5a2a72fb1bff140d1f583f3 (patch) | |
tree | 37eb5b28d99600d3b310e502218dbc8167adf986 /src/fix.c | |
parent | 97d44b5a002b61c7b95303bb8616f1caa6556bca (diff) | |
download | apk-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/fix.c')
-rw-r--r-- | src/fix.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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); |