From cfaff6e0c14d29f07246386695bce0188ce6f44b Mon Sep 17 00:00:00 2001 From: Olivier Brunel Date: Wed, 12 Feb 2014 16:32:30 +0100 Subject: Add events on pacnew/pacsave/pacorig file creation ALPM still adds a warning to the log, but doesn't emit an event about said warning, instead using a specific event to let the frontend what happened/how to inform the user. Note that there are 2 cases for installing a .pacnew file, to not overwrite user changes and because file is in NoUpgrade. In the later case the warning was a bit different: it happened before and said "extracting" instead of "installed." Now both happen after and are phrased the same. Signed-off-by: Olivier Brunel Signed-off-by: Allan McRae --- src/pacman/util.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/pacman/util.c') diff --git a/src/pacman/util.c b/src/pacman/util.c index 91f8fb3b..d42e27b8 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -1579,6 +1579,19 @@ int pm_asprintf(char **string, const char *format, ...) return ret; } +int pm_sprintf(char **string, alpm_loglevel_t level, const char *format, ...) +{ + int ret = 0; + va_list args; + + /* print the message using va_arg list */ + va_start(args, format); + ret = pm_vasprintf(string, level, format, args); + va_end(args); + + return ret; +} + int pm_vasprintf(char **string, alpm_loglevel_t level, const char *format, va_list args) { int ret = 0; -- cgit v1.2.3-54-g00ecf