summaryrefslogtreecommitdiff
path: root/CustomTarget_html.mk
diff options
context:
space:
mode:
authorChristian Lohmaier <cloph@documentfoundation.org>2022-12-18 22:03:35 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2022-12-18 21:54:39 +0000
commit6a83788dd6205cd600327ead7388bc5ad26fc7f7 (patch)
treecfabb7af90b00e9f0f158eda71d4e62477e9aee9 /CustomTarget_html.mk
parent1e092fa52ec29ae38cbe77092356c21543377977 (diff)
process files for bookmarks.part in bulk
instead of running xsltproc for each file, pass multiple files at once, greatly reducing the overhead of the processing, especially on Windows/cygwin. since it not only removes the need for the xsltproc invocations, but also for the surrounding workarounds with the rm, touch, rm of the indicator file. Change-Id: I4588bfc869c668a41da29b5d4080a600ed02223b Reviewed-on: https://gerrit.libreoffice.org/c/help/+/144409 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'CustomTarget_html.mk')
-rw-r--r--CustomTarget_html.mk39
1 files changed, 15 insertions, 24 deletions
diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk
index f3ff31ca9e..72576b04b1 100644
--- a/CustomTarget_html.mk
+++ b/CustomTarget_html.mk
@@ -276,31 +276,22 @@ $(eval $(foreach module,$(html_BMARK_MODULES),$(call html_gen_bookmarks_deps,$(s
# (similar to Bash's `set -o pipefail`; the final `rm $@.good` will fail, and fail the whole
# command, if any xsltproc invocation failed):
$(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/bookmarks.part : \
- $(SRCDIR)/helpcontent2/help3xsl/get_bookmark.xsl \
- $(SRCDIR)/helpcontent2/help3xsl/brand.xsl \
- $(call gb_ExternalExecutable_get_dependencies,xsltproc)
+ $(SRCDIR)/helpcontent2/help3xsl/get_bookmark.xsl \
+ $(SRCDIR)/helpcontent2/help3xsl/brand.xsl \
+ | $(call gb_ExternalExecutable_get_dependencies,xsltproc)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),XSL,1)
- $(call gb_Helper_abbreviate_dirs,\
- RESPONSEFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),$(addprefix $(if $(filter en-US,$(HELP_LANG)),$(SRCDIR),$(call gb_HelpTranslatePartTarget_get_workdir,$(HELP_LANG)))/,$(gb_AllLangHelp_$(APPDIR)_BOOKMARK_HELPFILES))) \
- && ( \
- <"$$RESPONSEFILE" $(if $(filter WNT,$(OS)),tr -d '\r' | env -i PATH="$$PATH") xargs -n 1 printf '%s\n' \
- | { rm -f $@.good && while read xhp; do \
- $(call gb_ExternalExecutable_get_command,xsltproc) \
- --stringparam app $(APP) \
- --stringparam Language $(HELP_LANG) \
- --stringparam local $(if $(HELP_ONLINE),'no','yes') \
- --stringparam productname "$(gb_PRODUCTNAME_HTML)" \
- --stringparam productversion "$(PRODUCTVERSION)" \
- $(SRCDIR)/helpcontent2/help3xsl/get_bookmark.xsl \
- $$xhp \
- || exit \
- ; done && touch $@.good; } \
- | sort -k3b -s \
- | awk 'NF' \
- && rm $@.good \
- ) > $@ \
- && rm "$$RESPONSEFILE" \
- )
+ RESPONSEFILE=$(call gb_var2file,$(shell $(gb_MKTEMP)),$(subst helpcontent2/source/text/,,$(gb_AllLangHelp_$(APPDIR)_BOOKMARK_HELPFILES))$(if $(filter WNT,$(OS)), )) \
+ && cd $(if $(filter en-US,$(HELP_LANG)),$(SRCDIR),$(call gb_HelpTranslatePartTarget_get_workdir,$(HELP_LANG)))/helpcontent2/source/text \
+ && ( \
+ $(call gb_ExternalExecutable_get_command,xsltproc,xargs) \
+ --stringparam app $(APP) \
+ --stringparam Language $(HELP_LANG) \
+ --stringparam local $(if $(HELP_ONLINE),'no','yes') \
+ --stringparam productname "$(gb_PRODUCTNAME_HTML)" \
+ --stringparam productversion "$(PRODUCTVERSION)" \
+ $(SRCDIR)/helpcontent2/help3xsl/get_bookmark.xsl \
+ <$$RESPONSEFILE || { rm $$RESPONSEFILE; exit 1; } \
+ ) | sort -k3b -s >$@ && rm "$$RESPONSEFILE"
# The various gid_File_Help_*_Zip in scp2 that use EXTRA_ALL_GOOD_HELP_LOCALIZATIONS_LANG expect
# $(module)/$(lang).filelist files containing lists of files (in instdir) for the corresponding