]> git.ipfire.org Git - pakfire.git/commitdiff
parser: Improve debugging output when expanding a value fails
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Dec 2021 13:10:20 +0000 (13:10 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 9 Dec 2021 13:10:20 +0000 (13:10 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/parser.c

index 0d4cab0fbf46e2a69291e830be36473d4867fca7..8b5d33319ae8172afe8e44bb94d0c8b27a9ce30a 100644 (file)
@@ -613,19 +613,25 @@ char* pakfire_parser_expand(struct pakfire_parser* parser,
 
        // Compile all regular expressions
        int r = pakfire_parser_compile_regexes(parser);
-       if (r)
+       if (r) {
+               DEBUG(parser->pakfire, "Could not compile regular expressions: %m\n");
                goto ERROR;
+       }
 
        // Expand all variables
        r = pakfire_parser_expand_variables(parser, namespace, &buffer);
-       if (r)
+       if (r) {
+               DEBUG(parser->pakfire, "Failed to expand variables in '%s': %m\n", value);
                goto ERROR;
+       }
 
        // Expand all commands
        if (parser->flags & PAKFIRE_PARSER_FLAGS_EXPAND_COMMANDS) {
                r = pakfire_parser_expand_commands(parser, &buffer);
-               if (r)
+               if (r) {
+                       DEBUG(parser->pakfire, "Failed to expand commands in '%s': %m\n", value);
                        goto ERROR;
+               }
        }
 
        return buffer;