Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/util/testpkg.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/testpkg.c')
-rw-r--r--src/util/testpkg.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/util/testpkg.c b/src/util/testpkg.c
index cc7d9c2b..39807feb 100644
--- a/src/util/testpkg.c
+++ b/src/util/testpkg.c
@@ -23,18 +23,20 @@
#include <alpm.h>
-__attribute__((format(printf, 2, 0)))
-static void output_cb(alpm_loglevel_t level, const char *fmt, va_list args)
+static void output_cb(alpm_event_log_t *event)
{
- if(fmt[0] == '\0') {
+ if(event->type != ALPM_EVENT_LOG) {
return;
}
- switch(level) {
+ if(event->fmt[0] == '\0') {
+ return;
+ }
+ switch(event->level) {
case ALPM_LOG_ERROR: printf("error: "); break;
case ALPM_LOG_WARNING: printf("warning: "); break;
default: return; /* skip other messages */
}
- vprintf(fmt, args);
+ vprintf(event->fmt, event->args);
}
int main(int argc, char *argv[])
@@ -59,7 +61,7 @@ int main(int argc, char *argv[])
}
/* let us get log messages from libalpm */
- alpm_option_set_logcb(handle, output_cb);
+ alpm_option_set_eventcb(handle, (alpm_cb_event) output_cb);
/* set gpgdir to default */
alpm_option_set_gpgdir(handle, GPGDIR);