From aabf18d56194405b28afcd814c41bbba73f5e9b9 Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Sun, 21 Apr 2024 22:15:14 +0200 Subject: [PATCH] Configuration_filter.mk: create RESPONSEFILEs using gb_var2file using echo ... | sed won't help with command-line limits and doing the simple substitution by make saves spawning a few sed processes Change-Id: I4ee81d26b3df18ebf82140f00c823cb7543cac1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166411 Reviewed-by: Christian Lohmaier Tested-by: Jenkins --- filter/Configuration_filter.mk | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk index b2d3b09689f0..42ebab575cd3 100644 --- a/filter/Configuration_filter.mk +++ b/filter/Configuration_filter.mk @@ -39,9 +39,7 @@ $(call gb_XcuFilterTypesTarget_get_target,%) : $(filter_MERGE_TARGET) $(call gb_Trace_StartRange,$*,FIT) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $@) && \ - RESPONSEFILE=`$(gb_MKTEMP)` && \ - echo "items=$(basename $(notdir $(filter %.xcu,$^)))" \ - | sed "s/ /$(COMMA)/g" > $${RESPONSEFILE} && \ + RESPONSEFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),items=$(subst $(WHITESPACE),$(COMMA),$(basename $(notdir $(filter %.xcu,$^))))) && \ $(filter_MERGE) tempdir=$(TMPDIR) \ share_subdir_name=$(LIBO_SHARE_FOLDER) \ fragmentsdir=$(dir $(firstword $(filter %.xcu,$^))).. \ @@ -82,9 +80,7 @@ $(call gb_XcuFilterFiltersTarget_get_target,%) : $(filter_MERGE_TARGET) $(call gb_Trace_StartRange,$*,FIF) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $@) && \ - RESPONSEFILE=`$(gb_MKTEMP)` && \ - echo "items=$(basename $(notdir $(filter %.xcu,$^)))" \ - | sed "s/ /$(COMMA)/g" > $${RESPONSEFILE} && \ + RESPONSEFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),items=$(subst $(WHITESPACE),$(COMMA),$(basename $(notdir $(filter %.xcu,$^))))) && \ $(filter_MERGE) tempdir=$(TMPDIR) \ share_subdir_name=$(LIBO_SHARE_FOLDER) \ fragmentsdir=$(dir $(firstword $(filter %.xcu,$^))).. \ @@ -115,12 +111,8 @@ $(call gb_XcuFilterOthersTarget_get_target,%) : $(filter_MERGE_TARGET) $(call gb_Trace_StartRange,$*,FIO) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $@) && \ - RESPONSEFILE=`$(gb_MKTEMP)` && \ - RESPONSEFILE2=`$(gb_MKTEMP)` && \ - echo "items=$(strip $(foreach xcu,$(filter %.xcu,$^),$(if $(filter frameloaders,$(notdir $(patsubst %/,%,$(dir $(xcu))))),$(basename $(notdir $(xcu),)))))" \ - | sed "s/ /$(COMMA)/g" > $${RESPONSEFILE} && \ - echo "items=$(strip $(foreach xcu,$(filter %.xcu,$^),$(if $(filter contenthandlers,$(notdir $(patsubst %/,%,$(dir $(xcu))))),$(basename $(notdir $(xcu),)))))" \ - | sed "s/ /$(COMMA)/g" > $${RESPONSEFILE2} && \ + RESPONSEFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),items=$(subst $(WHITESPACE),$(COMMA),$(strip $(foreach xcu,$(filter %.xcu,$^),$(if $(filter frameloaders,$(notdir $(patsubst %/,%,$(dir $(xcu))))),$(basename $(notdir $(xcu),))))))) && \ + RESPONSEFILE2=$(call gb_var2file,$(shell $(gb_MKTEMP)),items=$(subst $(WHITESPACE),$(COMMA),$(strip $(foreach xcu,$(filter %.xcu,$^),$(if $(filter contenthandlers,$(notdir $(patsubst %/,%,$(dir $(xcu))))),$(basename $(notdir $(xcu),))))))) && \ $(filter_MERGE) tempdir=$(TMPDIR) \ share_subdir_name=$(LIBO_SHARE_FOLDER) \ fragmentsdir=$(dir $(firstword $(filter %.xcu,$^))).. \ @@ -151,9 +143,7 @@ $(call gb_XcuFilterInternalTarget_get_target,%) : $(filter_MERGE_TARGET) $(call gb_Trace_StartRange,$*,FII) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $@) && \ - RESPONSEFILE=`$(gb_MKTEMP)` && \ - echo "items=$(basename $(notdir $(filter %.xcu,$^)))" \ - | sed "s/ /$(COMMA)/g" > $${RESPONSEFILE} && \ + RESPONSEFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),items=$(subst $(WHITESPACE),$(COMMA),$(basename $(notdir $(filter %.xcu,$^))))) && \ $(filter_MERGE) tempdir=$(TMPDIR) \ share_subdir_name=$(LIBO_SHARE_FOLDER) \ fragmentsdir=$(dir $(firstword $(filter %.xcu,$^))).. \ @@ -199,9 +189,7 @@ $(filter_XcuFilterUiTarget) : $(filter_MERGE_TARGET) $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),FIU) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(dir $@) && \ - RESPONSEFILE=`$(gb_MKTEMP)` && \ - echo "items=$(basename $(notdir $(filter %.xcu,$^)))" \ - | sed "s/ /$(COMMA)/g" > $${RESPONSEFILE} && \ + RESPONSEFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),items=$(subst $(WHITESPACE),$(COMMA),$(basename $(notdir $(filter %.xcu,$^))))) && \ $(filter_MERGE) tempdir=$(TMPDIR) \ share_subdir_name=$(LIBO_SHARE_FOLDER) \ fragmentsdir=$(dir $(firstword $(filter %.xcu,$^))).. \