summaryrefslogtreecommitdiff
path: root/src/apk.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/apk.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/apk.c')
-rw-r--r--src/apk.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/apk.c b/src/apk.c
index b60ae0f..e77d13f 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -50,6 +50,24 @@ static struct apk_option generic_options[] = {
required_argument, "TIME" },
};
+const char *apk_error_str(int error)
+{
+ if (error < 0)
+ error = -error;
+ switch (error) {
+ case ENOKEY:
+ return "UNTRUSTED signature";
+ case EKEYREJECTED:
+ return "BAD signature";
+ case EIO:
+ return "IO ERROR";
+ case EBADMSG:
+ return "BAD archive";
+ default:
+ return strerror(error);
+ }
+}
+
void apk_log(const char *prefix, const char *format, ...)
{
va_list va;