summaryrefslogtreecommitdiff
path: root/src/app_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app_policy.c')
-rw-r--r--src/app_policy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/app_policy.c b/src/app_policy.c
index 954eb9d..519257a 100644
--- a/src/app_policy.c
+++ b/src/app_policy.c
@@ -15,13 +15,13 @@
extern const char * const apk_installed_file;
-static void print_policy(struct apk_database *db, const char *match, struct apk_name *name, void *ctx)
+static int print_policy(struct apk_database *db, const char *match, struct apk_name *name, void *ctx)
{
struct apk_provider *p;
struct apk_repository *repo;
int i, j, num = 0;
- if (!name) return;
+ if (!name) return 0;
/*
zlib1g policy:
@@ -58,11 +58,13 @@ zlib1g policy:
}
}
}
+ return 0;
}
static int policy_main(void *ctx, struct apk_database *db, struct apk_string_array *args)
{
- apk_name_foreach_matching(db, args, apk_foreach_genid(), print_policy, NULL);
+ if (!args->num) return 0;
+ apk_db_foreach_sorted_name(db, args, print_policy, NULL);
return 0;
}