8199428: install-file macro fails on filenames with space on Solaris
Reviewed-by: tbell, ihse
--- 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 \