Skip to content

Commit bf32fd8

Browse files
authored
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
1 parent 91a8a1d commit bf32fd8

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

eb_hooks.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,20 @@
6767
}
6868

6969

70+
# Ensure that we don't print any messages in --terse mode
71+
orig_print_msg = print_msg
72+
orig_print_warning = print_warning
73+
74+
def print_msg(*args, **kwargs):
75+
if not build_option('terse'):
76+
orig_print_msg(*args, **kwargs)
77+
78+
79+
def print_warning(*args, **kwargs):
80+
if not build_option('terse'):
81+
orig_print_warning(*args, **kwargs)
82+
83+
7084
def is_gcccore_1220_based(**kwargs):
7185
# ecname, ecversion, tcname, tcversion):
7286
"""

0 commit comments

Comments
 (0)