diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-03-30 09:20:21 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-03-30 09:20:21 +0300 |
commit | ebaf8305b5c9cc5bdc5d640f4cb25e058f7a2c26 (patch) | |
tree | a18f6d42405757d2c9b12c62bd492ea367e1e5d0 /src | |
parent | 95cd7c571136989cfb4b9acb5181e63c324e3832 (diff) | |
download | apk-tools-ebaf8305b5c9cc5bdc5d640f4cb25e058f7a2c26.tar.gz apk-tools-ebaf8305b5c9cc5bdc5d640f4cb25e058f7a2c26.tar.bz2 apk-tools-ebaf8305b5c9cc5bdc5d640f4cb25e058f7a2c26.tar.xz apk-tools-ebaf8305b5c9cc5bdc5d640f4cb25e058f7a2c26.zip |
info: fix exit code for -e
fixes #1069
Diffstat (limited to 'src')
-rw-r--r-- | src/info.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -71,7 +71,7 @@ static int info_exists(struct info_ctx *ctx, struct apk_database *db, { struct apk_name *name; struct apk_dependency dep; - int i, j, ok = 0; + int i, j, ok, rc = 0; for (i = 0; i < argc; i++) { apk_blob_t b = APK_BLOB_STR(argv[i]); @@ -84,6 +84,7 @@ static int info_exists(struct info_ctx *ctx, struct apk_database *db, if (name == NULL) continue; + ok = 0; for (j = 0; j < name->providers->num; j++) { struct apk_provider *p = &name->providers->item[j]; if (p->pkg->ipkg == NULL) @@ -91,11 +92,13 @@ static int info_exists(struct info_ctx *ctx, struct apk_database *db, if (!apk_dep_is_provided(&dep, p)) continue; verbose_print_pkg(p->pkg, 0); + ok = 1; } - ok++; + if (!ok) + rc++; } - return argc - ok; + return rc; } static int info_who_owns(struct info_ctx *ctx, struct apk_database *db, |