From 3e5bd70c897ec937e7d32d187ea3124d44713cc5 Mon Sep 17 00:00:00 2001 From: erikj Date: Tue, 17 Oct 2017 15:46:09 +0200 Subject: [PATCH] 8189434: SetupCopyFiles does not handle files with $ in them Reviewed-by: ihse --- make/CompileDemos.gmk | 2 +- make/Images.gmk | 3 +-- make/common/MakeBase.gmk | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/make/CompileDemos.gmk b/make/CompileDemos.gmk index e0d7dc6251..695a8c2d45 100644 --- a/make/CompileDemos.gmk +++ b/make/CompileDemos.gmk @@ -299,7 +299,7 @@ ifneq ($(filter images, $(MAKECMDGOALS)), ) $(eval $(call SetupCopyFiles, COPY_TO_TEST_IMAGE, \ SRC := $(SUPPORT_OUTPUTDIR)/demos/image, \ DEST := $(TEST_IMAGE_DIR)/jdk/demos, \ - FILES := $(call DoubleDollar, $(call CacheFind, $(SUPPORT_OUTPUTDIR)/demos/image)), \ + FILES := $(call CacheFind, $(SUPPORT_OUTPUTDIR)/demos/image), \ )) IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE) diff --git a/make/Images.gmk b/make/Images.gmk index f6a740ecab..5d1c94181c 100644 --- a/make/Images.gmk +++ b/make/Images.gmk @@ -324,9 +324,8 @@ ifneq ($(filter jdk, $(MAKECMDGOALS)), ) DEMO_FILES := \ $(if $(wildcard $(SUPPORT_OUTPUTDIR)/demos/image), \ - $(call DoubleDollar, \ $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/demos/image \ - -type f -a ! \( -name "_the*" -o -name "javac_state" \) )) \ + -type f -a ! \( -name "_the*" -o -name "javac_state" \) ) \ ) ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true) diff --git a/make/common/MakeBase.gmk b/make/common/MakeBase.gmk index 3c86f303b1..ae77a21937 100644 --- a/make/common/MakeBase.gmk +++ b/make/common/MakeBase.gmk @@ -781,10 +781,19 @@ define SetupCopyFilesBody $1_SRC := $$(patsubst %/,%,$$($1_SRC)) $1_DEST := $$(patsubst %/,%,$$($1_DEST)) + # Need to wrap arguments in DoubleDollar because of the eval nested inside an + # eval macro body. $$(foreach f, $$(patsubst $$($1_SRC)/%,%,$$($1_FILES)), \ - $$(eval $$(call AddFileToCopy, $$($1_SRC)/$$f, \ - $$($1_DEST)/$$(call $$(strip $$($1_NAME_MACRO)),$$(if $$($1_FLATTEN),$$(notdir $$f),$$f)), \ - $1, $$($1_MACRO), $$($1_LOG_ACTION)))) + $$(eval $$(call AddFileToCopy, \ + $$(call DoubleDollar, $$($1_SRC)/$$f), \ + $$(call DoubleDollar, \ + $$($1_DEST)/$$(call $$(strip $$($1_NAME_MACRO)),$$(if $$($1_FLATTEN),$$(notdir $$f),$$f)) \ + ), \ + $1, \ + $$($1_MACRO), \ + $$($1_LOG_ACTION) \ + )) \ + ) endef