summaryrefslogtreecommitdiff
path: root/src/app_policy.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2020-10-05 18:52:51 +0300
committerTimo Teräs <timo.teras@iki.fi>2020-10-09 16:09:19 +0300
commit354713d2f746c197eed6a1feb4c6af3420af6c15 (patch)
treef9dd51bbdde0f25f8e122832cf006076b8452d28 /src/app_policy.c
parent7a7eca86709fcf31dbb1acf8b82ff411828fb67b (diff)
downloadapk-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_policy.c')
-rw-r--r--src/app_policy.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/app_policy.c b/src/app_policy.c
index 954eb9d..91e97d0 100644
--- a/src/app_policy.c
+++ b/src/app_policy.c
@@ -17,6 +17,7 @@ extern const char * const apk_installed_file;
static void print_policy(struct apk_database *db, const char *match, struct apk_name *name, void *ctx)
{
+ struct apk_out *out = &db->ctx->out;
struct apk_provider *p;
struct apk_repository *repo;
int i, j, num = 0;
@@ -41,17 +42,17 @@ zlib1g policy:
if (p->pkg->name != name)
continue;
if (num++ == 0)
- printf("%s policy:\n", name->name);
- printf(" " BLOB_FMT ":\n", BLOB_PRINTF(*p->version));
+ apk_out(out, "%s policy:", name->name);
+ apk_out(out, " " BLOB_FMT ":", BLOB_PRINTF(*p->version));
if (p->pkg->ipkg != NULL)
- printf(" %s\n", apk_installed_file);
+ apk_out(out, " %s", apk_installed_file);
for (i = 0; i < db->num_repos; i++) {
repo = &db->repos[i];
if (!(BIT(i) & p->pkg->repos))
continue;
for (j = 0; j < db->num_repo_tags; j++) {
if (db->repo_tags[j].allowed_repos & p->pkg->repos)
- printf(" "BLOB_FMT"%s%s\n",
+ apk_out(out, " "BLOB_FMT"%s%s",
BLOB_PRINTF(db->repo_tags[j].tag),
j == 0 ? "" : " ",
repo->url);