From 95a6bd68d34bf5530bb9ca0e414cfc00b1c2904b Mon Sep 17 00:00:00 2001 From: Tony Ambardar Date: Mon, 13 Nov 2023 18:39:02 -0800 Subject: [PATCH] Revert "verbose.mk: print ERROR messages in non-verbose" This reverts commit aee3594ffcb72ae3e18c3719012d52519ee2d160 as it breaks existing uses of '$(call ERROR_MESSAGE,...)' during verbose builds. For example, 'Build/check-size' doesn't print error messages on failed checks, rather the printing itself fails with: bash: line 1: 8: Bad file descriptor This happens because the commit doesn't properly handle shell redirects across makes/submakes during the build process, and later attempts to fix this showed the problem isn't trivial. Signed-off-by: Tony Ambardar --- include/verbose.mk | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/verbose.mk b/include/verbose.mk index 4487a207e87775..3ecf842d11831c 100644 --- a/include/verbose.mk +++ b/include/verbose.mk @@ -29,15 +29,15 @@ ifeq ($(IS_TTY),1) endif endif -define ERROR_MESSAGE - printf "$(_R)%s$(_N)\n" "$(1)" >&8 -endef - ifeq ($(findstring s,$(OPENWRT_VERBOSE)),) define MESSAGE printf "$(_Y)%s$(_N)\n" "$(1)" >&8 endef + define ERROR_MESSAGE + printf "$(_R)%s$(_N)\n" "$(1)" >&8 + endef + ifeq ($(QUIET),1) ifneq ($(CURDIR),$(TOPDIR)) _DIR:=$(patsubst $(TOPDIR)/%,%,${CURDIR}) @@ -60,4 +60,5 @@ else define MESSAGE printf "%s\n" "$(1)" endef + ERROR_MESSAGE=$(MESSAGE) endif