8204682: Parsing for LOG=report=none is broken when combined with other keywords

Reviewed-by: erikj
This commit is contained in:
Magnus Ihse Bursie 2018-06-11 20:18:38 +02:00
parent 77837d06d1
commit 8fe36bed48

View File

@ -34,6 +34,9 @@ _INITSUPPORT_GMK := 1
ifeq ($(HAS_SPEC),)
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# Include the corresponding closed file, if present.
ifneq ($(CUSTOM_MAKE_DIR), )
-include $(CUSTOM_MAKE_DIR)/InitSupport.gmk
@ -531,8 +534,6 @@ endif # HAS_SPEC
define ParseLogOption
ifneq ($$(findstring $1, $$(LOG)),)
override $2 := true
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $1,, $$(subst $$(COMMA)$$(strip $1),, $$(LOG)))
# We might have ended up with a leading comma. Remove it. Need override
@ -550,8 +551,6 @@ define ParseLogValue
# Make words of out comma-separated list and find the one with opt=val
value := $$(strip $$(subst $$(strip $1)=,, $$(filter $$(strip $1)=%, $$(subst $$(COMMA), , $$(LOG)))))
override $2 := $$(value)
# COMMA is defined in spec.gmk, but that is not included yet
COMMA := ,
# First try to remove ",<option>" if it exists, otherwise just remove "<option>"
LOG_STRIPPED := $$(subst $$(strip $1)=$$(value),, \
$$(subst $$(COMMA)$$(strip $1)=$$(value),, $$(LOG)))