8189434: SetupCopyFiles does not handle files with $ in them
authorerikj
Tue, 17 Oct 2017 15:46:09 +0200
changeset 47354 e8bda13da40b
parent 47353 a6d4932d582e
child 47355 8cf060fad8a8
8189434: SetupCopyFiles does not handle files with $ in them Reviewed-by: ihse
make/CompileDemos.gmk
make/Images.gmk
make/common/MakeBase.gmk
--- a/make/CompileDemos.gmk	Mon Jun 26 17:00:45 2017 +0200
+++ b/make/CompileDemos.gmk	Tue Oct 17 15:46:09 2017 +0200
@@ -299,7 +299,7 @@
   $(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)
--- a/make/Images.gmk	Mon Jun 26 17:00:45 2017 +0200
+++ b/make/Images.gmk	Tue Oct 17 15:46:09 2017 +0200
@@ -324,9 +324,8 @@
 
   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)
--- a/make/common/MakeBase.gmk	Mon Jun 26 17:00:45 2017 +0200
+++ b/make/common/MakeBase.gmk	Tue Oct 17 15:46:09 2017 +0200
@@ -781,10 +781,19 @@
   $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