aboutsummaryrefslogtreecommitdiffstats
path: root/src/print.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2013-06-13 18:20:39 +0300
committerTimo Teräs <timo.teras@iki.fi>2013-06-13 18:22:00 +0300
commite51232e710dfd32764e2c2d0599df83ab85a9c74 (patch)
tree5eac93c05cf2fe77d2857a48a9fc55c7bf7e33d0 /src/print.c
parent25ff68a87e3264b6dfdc846823d4912b4dd870b2 (diff)
downloadaports-e51232e710dfd32764e2c2d0599df83ab85a9c74.tar.bz2
aports-e51232e710dfd32764e2c2d0599df83ab85a9c74.tar.xz
errors: rewrite the logic how errors are reported
Instead of the dependency oriented logic, switch to print them for each package or name needed. Might give a bit more readable errors now. There's still few corner cases that proper error is not output, which are cought by the test cases.
Diffstat (limited to 'src/print.c')
-rw-r--r--src/print.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/print.c b/src/print.c
index b47d8d7e78..93ef931158 100644
--- a/src/print.c
+++ b/src/print.c
@@ -57,6 +57,18 @@ void apk_print_indented_words(struct apk_indent *i, const char *text)
(apk_blob_cb) apk_print_indented, i);
}
+void apk_print_indented_fmt(struct apk_indent *i, const char *fmt, ...)
+{
+ char tmp[256];
+ size_t n;
+ va_list va;
+
+ va_start(va, fmt);
+ n = vsnprintf(tmp, sizeof(tmp), fmt, va);
+ apk_print_indented(i, APK_BLOB_PTR_LEN(tmp, n));
+ va_end(va);
+}
+
const char *apk_error_str(int error)
{
if (error < 0)