Skip to contentSkip to conversation

tests/docker/Makefile.include: handle empty TARGET_LIST

PATCH Superseded Alex Bennée 2 participants 2 messages May 18, 2018 – May 21, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/docker/Makefile.include: handle empty TARGET_LIST

If the user doesn't specify a TARGET_LIST they get the current configuration but with spaces and hilarity ensues. This adds some make magic to turn the TARGET_LIST back into a comma separated list.

---
 tests/docker/Makefile.include | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/docker/Makefile.include +5 -1
index d00887bdf1..eccd5f7d68 100644
@@ -125,6 +125,10 @@ docker:
 	@echo '    EXTRA_FILES="<path> [... <path>]"'
 	@echo '                         Include extra files in image.'
 
+null  :=
+space := $(null) #
+comma := ,
+
 # This rule if for directly running against an arbitrary docker target.
 # It is called by the expanded docker targets (e.g. make
 # docker-test-foo@bar) which will do additional verification.
@@ -148,7 +152,7 @@ docker-run: docker-qemu-src
 			$(if $V,,--rm) 					\
 			$(if $(DEBUG),-ti,)				\
 			$(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \
-			-e TARGET_LIST=$(TARGET_LIST) 			\
+			-e TARGET_LIST=$(subst $(space),$(comma),$(TARGET_LIST))	\
 			-e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \
 			-e V=$V -e J=$J -e DEBUG=$(DEBUG)		\
 			-e SHOW_ENV=$(SHOW_ENV) 			\
Signature · 1 line
2.17.0
#1 lore raw
Quoted 14 lines · Alex Bennée

If the user doesn't specify a TARGET_LIST they get the current configuration but with spaces and hilarity ensues. This adds some make magic to turn the TARGET_LIST back into a comma separated list.

---
 tests/docker/Makefile.include | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
tests/docker/Makefile.include +0 -0
index d00887bdf1..eccd5f7d68 100644

tests/docker/Makefile.include docker: · line 130

Quoted 6 lines
tests/docker/Makefile.include +3 -0
@@ -125,6 +125,10 @@ docker:
 	@echo '    EXTRA_FILES="<path> [... <path>]"'
 	@echo '                         Include extra files in image.'
 
+null  :=
+space := $(null) #
+comma := ,

We have $(COMMA) in rules.mak, please add space there.

Quoted 16 lines
tests/docker/Makefile.include +2 -1
+
 # This rule if for directly running against an arbitrary docker target.
 # It is called by the expanded docker targets (e.g. make
 # docker-test-foo@bar) which will do additional verification.
@@ -148,7 +152,7 @@ docker-run: docker-qemu-src
 			$(if $V,,--rm) 					\
 			$(if $(DEBUG),-ti,)				\
 			$(if $(NETWORK),$(if $(subst $(NETWORK),,1),--net=$(NETWORK)),--net=none) \
-			-e TARGET_LIST=$(TARGET_LIST) 			\
+			-e TARGET_LIST=$(subst $(space),$(comma),$(TARGET_LIST))	\
 			-e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \
 			-e V=$V -e J=$J -e DEBUG=$(DEBUG)		\
 			-e SHOW_ENV=$(SHOW_ENV) 			\
Signature · 1 line
2.17.0

Fam