summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-12-15 10:20:30 +0000
committerTimo Teräs <timo.teras@iki.fi>2011-01-25 13:21:42 +0200
commit4d89c0744488ddf828a8d1cf4e80ec6f1a390ebc (patch)
tree8b1ecee90566b74869baa987c2d58c13884c8daf
parent0b795531a9dd1507d72d4c6759ed1d3688bf62ae (diff)
info: return error if owning package was not found
(cherry picked from commit cdeb9caaad10b15b56b41fd159d6fc73a6aac610)
-rw-r--r--src/info.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/info.c b/src/info.c
index 19a3f48..b16f188 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)