diff options
author | Timo Teräs <timo.teras@iki.fi> | 2020-10-05 18:52:51 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-10-09 16:09:19 +0300 |
commit | 354713d2f746c197eed6a1feb4c6af3420af6c15 (patch) | |
tree | f9dd51bbdde0f25f8e122832cf006076b8452d28 /src/app_update.c | |
parent | 7a7eca86709fcf31dbb1acf8b82ff411828fb67b (diff) | |
download | apk-tools-354713d2f746c197eed6a1feb4c6af3420af6c15.tar.gz apk-tools-354713d2f746c197eed6a1feb4c6af3420af6c15.tar.bz2 apk-tools-354713d2f746c197eed6a1feb4c6af3420af6c15.tar.xz apk-tools-354713d2f746c197eed6a1feb4c6af3420af6c15.zip |
rename apk_db_options to apk_ctx, rework logging
makes apk_verbosity non-global
fixes #10682
Diffstat (limited to 'src/app_update.c')
-rw-r--r-- | src/app_update.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/app_update.c b/src/app_update.c index 70b7460..4fa24f8 100644 --- a/src/app_update.c +++ b/src/app_update.c @@ -16,11 +16,12 @@ static int update_main(void *ctx, struct apk_database *db, struct apk_string_array *args) { + struct apk_out *out = &db->ctx->out; struct apk_repository *repo; int i; char buf[32] = "OK:"; - if (apk_verbosity < 1) + if (apk_out_verbosity(out) < 1) return db->repo_update_errors; for (i = 0; i < db->num_repos; i++) { @@ -29,15 +30,15 @@ static int update_main(void *ctx, struct apk_database *db, struct apk_string_arr if (APK_BLOB_IS_NULL(repo->description)) continue; - apk_message(BLOB_FMT " [%s]", - BLOB_PRINTF(repo->description), - db->repos[i].url); + apk_msg(out, BLOB_FMT " [%s]", + BLOB_PRINTF(repo->description), + db->repos[i].url); } if (db->repo_update_errors != 0) snprintf(buf, sizeof(buf), "%d errors;", db->repo_update_errors); - apk_message("%s %d distinct packages available", buf, + apk_msg(out, "%s %d distinct packages available", buf, db->available.packages.num_items); return db->repo_update_errors; |