summaryrefslogtreecommitdiff
path: root/src/info.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-12-15 10:20:30 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-12-15 10:33:39 +0000
commitcdeb9caaad10b15b56b41fd159d6fc73a6aac610 (patch)
tree5219f301dd231eb6359a79beead01a10ea2c4488 /src/info.c
parent972bec32101fb6d03f82fdf1f3be6106097fbf37 (diff)
downloadapk-tools-cdeb9caaad10b15b56b41fd159d6fc73a6aac610.tar.gz
apk-tools-cdeb9caaad10b15b56b41fd159d6fc73a6aac610.tar.bz2
apk-tools-cdeb9caaad10b15b56b41fd159d6fc73a6aac610.tar.xz
apk-tools-cdeb9caaad10b15b56b41fd159d6fc73a6aac610.zip
info: return error if owning package was not found
Diffstat (limited to 'src/info.c')
-rw-r--r--src/info.c9
1 files changed, 6 insertions, 3 deletions
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)