From cdeb9caaad10b15b56b41fd159d6fc73a6aac610 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 15 Dec 2010 10:20:30 +0000 Subject: info: return error if owning package was not found --- src/info.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/info.c b/src/info.c index f345b53..2a28a93 100644 --- a/src/info.c +++ b/src/info.c @@ -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) -- cgit v1.2.3