jobextra/pacman-contrib/0001-pactree-fix-compilatio...

45 lines
1.4 KiB
Diff

From fd21ee241c85856be941e41942d6c179ca713c41 Mon Sep 17 00:00:00 2001
From: Eli Schwartz via pacman-contrib <pacman-contrib@lists.archlinux.org>
Date: Fri, 21 May 2021 00:30:07 -0400
Subject: [PATCH] pactree: fix compilation with pacman 6
In "add front-end provided context to callbacks", libalpm gained a new
argument to callbacks which we don't use and is only needed by some
frontends wishing to do stuff with the callback state. NULL it and move
on with life, just like pacman itself did.
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Daniel M. Capella <polyzen@archlinux.org>
---
src/pactree.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/pactree.c b/src/pactree.c
index e8f5086..9e6ac1b 100644
--- a/src/pactree.c
+++ b/src/pactree.c
@@ -135,8 +135,10 @@ static const char *dbpath = DBPATH;
static const char *configfile = CONFFILE;
static const char *gpgdir = GPGDIR;
-void cb_log(alpm_loglevel_t level, const char *fmt, va_list args)
+void cb_log(void *ctx, alpm_loglevel_t level, const char *fmt, va_list args)
{
+ (void)ctx;
+
switch(level) {
case ALPM_LOG_ERROR:
fprintf(stderr, "%s%s%s", color->error, "error: ",
@@ -621,7 +623,7 @@ int main(int argc, char *argv[])
}
if(debug) {
- alpm_option_set_logcb(handle, cb_log);
+ alpm_option_set_logcb(handle, cb_log, NULL);
}
/* no need to fail on error here */
--
2.31.1