Commit 4d89c074 authored by Natanael Copa's avatar Natanael Copa Committed by Timo Teräs

info: return error if owning package was not found

(cherry picked from commit cdeb9caa)
parent 0b795531
......@@ -101,13 +101,16 @@ static int info_who_owns(struct info_ctx *ctx, struct apk_database *db,
struct apk_package *pkg;
struct apk_dependency_array *deps;
struct apk_dependency dep;
int i;
int i, r=0;
apk_dependency_array_init(&deps);
for (i = 0; i < argc; i++) {
pkg = apk_db_get_file_owner(db, APK_BLOB_STR(argv[i]));
if (pkg == NULL)
if (pkg == NULL) {
apk_error("%s: Could not find owner package", argv[i]);
r++;
continue;
}
if (apk_verbosity < 1) {
dep = (struct apk_dependency) {
......@@ -130,7 +133,7 @@ static int info_who_owns(struct info_ctx *ctx, struct apk_database *db,
}
apk_dependency_array_free(&deps);
return 0;
return r;
}
static void info_print_description(struct apk_package *pkg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment