summaryrefslogtreecommitdiff
path: root/src/upgrade.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-14 20:26:48 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-14 20:26:48 +0300
commitedf03b155ba419b00dde585b3d35969621a024df (patch)
treec397c917cd6898101cd840790f2e24523057e14d /src/upgrade.c
parent59d15ab2599777b24e65fad7a1fb052de4f5ef38 (diff)
downloadapk-tools-edf03b155ba419b00dde585b3d35969621a024df.tar.gz
apk-tools-edf03b155ba419b00dde585b3d35969621a024df.tar.bz2
apk-tools-edf03b155ba419b00dde585b3d35969621a024df.tar.xz
apk-tools-edf03b155ba419b00dde585b3d35969621a024df.zip
audit, index, search, upgrade: use foreach_array_item
Diffstat (limited to 'src/upgrade.c')
-rw-r--r--src/upgrade.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/upgrade.c b/src/upgrade.c
index 8c8284d..335afa6 100644
--- a/src/upgrade.c
+++ b/src/upgrade.c
@@ -89,8 +89,9 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg
{
struct upgrade_ctx *uctx = (struct upgrade_ctx *) ctx;
unsigned short solver_flags;
+ struct apk_dependency *dep;
struct apk_dependency_array *world = NULL;
- int i, r;
+ int r;
if (apk_db_check_world(db, db->world) != 0) {
apk_error("Not continuing with upgrade due to missing repository tags. Use --force to override.");
@@ -106,8 +107,7 @@ static int upgrade_main(void *ctx, struct apk_database *db, int argc, char **arg
if (solver_flags & APK_SOLVERF_AVAILABLE) {
apk_dependency_array_copy(&world, db->world);
- for (i = 0; i < world->num; i++) {
- struct apk_dependency *dep = &world->item[i];
+ foreach_array_item(dep, world) {
if (dep->result_mask == APK_DEPMASK_CHECKSUM) {
dep->result_mask = APK_DEPMASK_ANY;
dep->version = apk_blob_atomize(APK_BLOB_NULL);