changeset 49636:d1a19a08389a

8199428: install-file macro fails on filenames with space on Solaris Reviewed-by: tbell, ihse
author erikj
date Mon, 12 Mar 2018 17:49:08 +0100
parents 564802b01ded
children e991d0be4cc9
files make/common/MakeBase.gmk
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/make/common/MakeBase.gmk	Mon Mar 12 17:00:54 2018 +0100
+++ b/make/common/MakeBase.gmk	Mon Mar 12 17:49:08 2018 +0100
@@ -518,12 +518,14 @@
   define install-file
 	$(call MakeTargetDir)
 	$(RM) '$(call DecodeSpace, $@)'
-	if [ '$(call DecodeSpace, $(dir $@))' != \
+	if [ '$(call DecodeSpace, $(dir $(call EncodeSpace, $@)))' != \
 	    '$(call DecodeSpace, $(dir $(call EncodeSpace, $<)))' ]; then \
-	  $(CP) -f -r -P '$(call DecodeSpace, $<)' '$(call DecodeSpace, $(@D))'; \
-	  if [ '$(call DecodeSpace, $(@F))' != \
+	  $(CP) -f -r -P '$(call DecodeSpace, $<)' \
+	      '$(call DecodeSpace, $(dir $(call EncodeSpace, $@)))'; \
+	  if [ '$(call DecodeSpace, $(notdir $(call EncodeSpace, $@)))' != \
 	      '$(call DecodeSpace, $(notdir $(call EncodeSpace, $(<))))' ]; then \
-	    $(MV) '$(call DecodeSpace, $(@D)/$(<F))' '$(call DecodeSpace, $@)'; \
+	    $(MV) '$(call DecodeSpace, $(dir $(call EncodeSpace, $@))/$(notdir $(call EncodeSpace, $<)))' \
+	        '$(call DecodeSpace, $@)'; \
 	  fi; \
 	else \
 	  if [ -L '$(call DecodeSpace, $<)' ]; then \