Skip to content

Commit

Permalink
8189434: SetupCopyFiles does not handle files with $ in them
Browse files Browse the repository at this point in the history
Reviewed-by: ihse
  • Loading branch information
erikj committed Oct 17, 2017
1 parent 69c5e44 commit 3e5bd70
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion make/CompileDemos.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions make/Images.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 12 additions & 3 deletions make/common/MakeBase.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3e5bd70

Please sign in to comment.