summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
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;