From 700db42d5474d55db496119d6d4ba9dd87f3e2e8 Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Mon, 5 Nov 2018 12:02:46 +0000 Subject: [PATCH] Quote message in echo-error/echo-warning macros Makes pretty-error and pretty-warning behave more like $(error) and $(warning), where you don't need to do things like quote parentheses. Bug: 118833208 Test: trigger the private_apis && sdk set error in sdk_check.mk, which no longer produces bash syntax errors Change-Id: I766ff98ad4e652f59dbef9dd5654f1cd10a2d038 --- core/definitions.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index c9df7006d7..bc63e2daa6 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -797,13 +797,13 @@ ESC_RESET := \033[0m # $(1): path (and optionally line) information # $(2): message to print define echo-warning -echo -e "$(ESC_BOLD)$(1): $(ESC_WARNING)warning:$(ESC_RESET)$(ESC_BOLD)" $(2) "$(ESC_RESET)" >&2 +echo -e "$(ESC_BOLD)$(1): $(ESC_WARNING)warning:$(ESC_RESET)$(ESC_BOLD)" '$(subst ','\'',$(2))' "$(ESC_RESET)" >&2 endef # $(1): path (and optionally line) information # $(2): message to print define echo-error -echo -e "$(ESC_BOLD)$(1): $(ESC_ERROR)error:$(ESC_RESET)$(ESC_BOLD)" $(2) "$(ESC_RESET)" >&2 +echo -e "$(ESC_BOLD)$(1): $(ESC_ERROR)error:$(ESC_RESET)$(ESC_BOLD)" '$(subst ','\'',$(2))' "$(ESC_RESET)" >&2 endef ###########################################################