[pacman-contrib] [PATCH] pactree: fix compilation with pacman 6

Eli Schwartz eschwartz at archlinux.org
Fri May 21 04:30:07 UTC 2021


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 at 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


More information about the pacman-contrib mailing list