]> git.ipfire.org Git - pakfire.git/commitdiff
parser: Use default stdout log capturer
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Jun 2021 14:37:42 +0000 (14:37 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 2 Jun 2021 14:37:42 +0000 (14:37 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/parser.c

index efd6b6120b85702d3fbbd1af18a7647598378e01..bd7304b6cbf08efefa09dba17a3f3b665fbede30 100644 (file)
@@ -372,16 +372,6 @@ PAKFIRE_EXPORT int pakfire_parser_append(PakfireParser parser,
        return r;
 }
 
-static int pakfire_parser_command_logger(Pakfire pakfire, void* data,
-               int priority, const char* line, size_t length) {
-       char** output = (char**)data;
-
-       // Append output
-       asprintf(output, "%s%s", (output && *output) ? *output : "", line);
-
-       return 0;
-}
-
 static int pakfire_parser_expand_commands(PakfireParser parser, char** buffer) {
        int r = 0;
        PCRE2_UCHAR* command = NULL;
@@ -426,7 +416,7 @@ static int pakfire_parser_expand_commands(PakfireParser parser, char** buffer) {
 
                // Execute the command inside the Pakfire environment
                r = pakfire_execute(parser->pakfire, argv, NULL, 0,
-                               pakfire_parser_command_logger, &output);
+                               pakfire_execute_capture_stdout, &output);
                if (r) {
                        // Just log this and continue
                        DEBUG(parser->pakfire, "Command '%s' failed with return code %d\n", command, r);