pkg-utils: qstrip MESSAGE
PATCH 1/1 pkg-utils: qstrip MESSAGE
Currently, the MESSAGE macro double-quotes the message. But a few call sites also double-quote the message, resulting in a borked call to echo, like:
$(call MESSAGE,"user text")
would expand to:
echo "Leading text "user message" trailign text"
Just use qstrip on the user message, so we get protected from either a comma in the user text (so make does not interpret it), or a semi-colon (so the shell does not interpret it.)
--- package/pkg-utils.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-utils.mk +1 -1
@@ -67,7 +67,7 @@ INFLATE.tar = cat suitable-extractor = $(INFLATE$(suffix $(1))) # MESSAGE Macro -- display a message in bold type -MESSAGE = echo "$(TERM_BOLD)>>> $($(PKG)_NAME) $($(PKG)_VERSION) $(1)$(TERM_RESET)" +MESSAGE = echo "$(TERM_BOLD)>>> $($(PKG)_NAME) $($(PKG)_VERSION) $(call qstrip,$(1))$(TERM_RESET)" TERM_BOLD := $(shell tput smso) TERM_RESET := $(shell tput rmso)
Signature · 1 line
1.9.1
PATCH 1/1 pkg-utils: qstrip MESSAGE
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
Currently, the MESSAGE macro double-quotes the message. But a few call sites also double-quote the message, resulting in a borked call to echo, like:
$(call MESSAGE,"user text")would expand to:
echo "Leading text "user message" trailign text"
Quoted 7 lines
Just use qstrip on the user message, so we get protected from either a comma in the user text (so make does not interpret it), or a semi-colon (so the shell does not interpret it.)
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Peter Korsgaard <[email protected]>Cc Thomas De Schampheleire <[email protected]>
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard