diff options
-rw-r--r-- | src/app_del.c | 2 | ||||
-rw-r--r-- | src/app_fetch.c | 6 | ||||
-rw-r--r-- | src/database.c | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/app_del.c b/src/app_del.c index 06deb43..e5c6aab 100644 --- a/src/app_del.c +++ b/src/app_del.c @@ -145,7 +145,7 @@ static int del_main(void *pctx, struct apk_database *db, struct apk_string_array int r = 0; apk_dependency_array_copy(&ctx->world, db->world); - apk_db_foreach_matching_name(db, args, delete_name, ctx); + if (args->num) apk_db_foreach_matching_name(db, args, delete_name, ctx); if (ctx->errors) return ctx->errors; r = apk_solver_solve(db, 0, ctx->world, &changeset); diff --git a/src/app_fetch.c b/src/app_fetch.c index 11602c1..58afff4 100644 --- a/src/app_fetch.c +++ b/src/app_fetch.c @@ -370,12 +370,14 @@ static int fetch_main(void *pctx, struct apk_database *db, struct apk_string_arr apk_dependency_array_init(&ctx->world); foreach_array_item(dep, db->world) mark_dep_flags(ctx, dep); - apk_db_foreach_matching_name(db, args, mark_name_flags, ctx); + if (args->num) + apk_db_foreach_matching_name(db, args, mark_name_flags, ctx); if (ctx->errors == 0) mark_names_recursive(db, args, ctx); apk_dependency_array_free(&ctx->world); } else { - apk_db_foreach_matching_name(db, args, mark_name, ctx); + if (args->num) + apk_db_foreach_matching_name(db, args, mark_name, ctx); } if (!ctx->errors) apk_db_foreach_sorted_package(db, NULL, fetch_package, ctx); diff --git a/src/database.c b/src/database.c index d7f197b..48b5f17 100644 --- a/src/database.c +++ b/src/database.c @@ -3049,14 +3049,14 @@ int apk_db_foreach_matching_name(struct apk_database *db, struct apk_string_arra struct apk_name *name; struct match_ctx mctx = { .db = db, - .filter = filter, .cb = cb, .cb_ctx = ctx, }; int r; - if (!filter || !filter->num) return 0; + if (!filter || !filter->num) goto all; + mctx.filter = filter; foreach_array_item(pmatch, filter) if (strchr(*pmatch, '*') != NULL) goto all; |