summaryrefslogtreecommitdiff
path: root/src/add.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-22 14:56:27 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-22 14:56:27 +0300
commit93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8 (patch)
tree84261f2a088ff9bf53a6db30669602f159a01b00 /src/add.c
parent0a7991f70dcfe9f8e05f6a4a4a59af21be878915 (diff)
downloadapk-tools-93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8.tar.gz
apk-tools-93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8.tar.bz2
apk-tools-93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8.tar.xz
apk-tools-93f0b3524c1263b99a1a4bf718c27e6ad7b6aea8.zip
various: more informative error messages
Diffstat (limited to 'src/add.c')
-rw-r--r--src/add.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/add.c b/src/add.c
index f78b4e0..4dd93e9 100644
--- a/src/add.c
+++ b/src/add.c
@@ -120,10 +120,10 @@ static int add_main(void *ctx, int argc, char **argv)
struct apk_sign_ctx sctx;
apk_sign_ctx_init(&sctx, APK_SIGN_VERIFY, NULL);
- pkg = apk_pkg_read(&db, argv[i], &sctx);
+ r = apk_pkg_read(&db, argv[i], &sctx, &pkg);
apk_sign_ctx_free(&sctx);
- if (pkg == NULL) {
- apk_error("Unable to read '%s'", argv[i]);
+ if (r != 0) {
+ apk_error("%s: %s", argv[i], apk_error_str(r));
goto err;
}