From bf32fd8390d7b5153525aba967d16adfb3ee6cf0 Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Mon, 8 Sep 2025 14:16:45 +0200 Subject: [PATCH] Don't print messages from hook in `--terse` mode The output from the hook such as "Using custom configure options" makes the output not machine-readable which it should be in `--terse` mode. Check the option in a hook-function before calling the original one --- eb_hooks.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/eb_hooks.py b/eb_hooks.py index e855d99a..20e4b53f 100644 --- a/eb_hooks.py +++ b/eb_hooks.py @@ -67,6 +67,20 @@ } +# Ensure that we don't print any messages in --terse mode +orig_print_msg = print_msg +orig_print_warning = print_warning + +def print_msg(*args, **kwargs): + if not build_option('terse'): + orig_print_msg(*args, **kwargs) + + +def print_warning(*args, **kwargs): + if not build_option('terse'): + orig_print_warning(*args, **kwargs) + + def is_gcccore_1220_based(**kwargs): # ecname, ecversion, tcname, tcversion): """