diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-02-22 09:23:17 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-02-22 09:24:48 +0100 |
commit | c3509fb7e6675a38560c7e2764b21861d1e23362 (patch) | |
tree | e14adfe9423283dec5c7d8cad454e5620798ae00 /CustomTarget_html.mk | |
parent | 49d8f790a781c027b19772daf72820e6c9572f6b (diff) |
Propagate xsltproc failure
Change-Id: I26516bb718b678718822ef8621bbfb868016d626
Reviewed-on: https://gerrit.libreoffice.org/68192
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'CustomTarget_html.mk')
-rw-r--r-- | CustomTarget_html.mk | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk index b3c9b4e69a..c9ef46cae8 100644 --- a/CustomTarget_html.mk +++ b/CustomTarget_html.mk @@ -28,6 +28,9 @@ $(eval $(call gb_CustomTarget_register_targets,helpcontent2/help3xsl,\ ) \ )) +# In the below recipe, the file $@.good is used to communicate failure of xsltproc in the pipeline +# (similar to Bash's `set -o pipefail`; the final `rm $@.good` will fail, and fail the whole +# command, if the xsltproc invocation failed): $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/hid2file.js : \ $(SRCDIR)/helpcontent2/help3xsl/generate_hid2file.xsl \ $(call gb_ExternalExecutable_get_dependencies,xsltproc) \ @@ -40,8 +43,10 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/hid2file.js : \ && RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,$(foreach module,$(html_TEXT_MODULES),$(addprefix $(SRCDIR)/,$(gb_AllLangHelp_$(module)_HELPFILES)))) \ && <"$$RESPONSEFILE" $(if $(filter WNT,$(OS)),tr -d '\r' | env -i PATH="$$PATH") xargs -n 1 printf '%s\n' \ | while read xhp; do \ - $(call gb_ExternalExecutable_get_command,xsltproc) $< $$xhp \ + rm -f $@.good && \ + { $(call gb_ExternalExecutable_get_command,xsltproc) $< $$xhp && touch $@.good; } \ | $(gb_AWK) 'NF' \ + && rm $@.good \ ; done \ && rm "$$RESPONSEFILE" \ && echo '};' \ @@ -193,6 +198,9 @@ endef $(eval $(foreach module,$(html_BMARK_MODULES),$(call html_gen_bookmarks_deps,$(subst :, ,$(module))))) +# In the below recipe, the file $@.good is used to communicate failure of xsltproc in the pipeline +# (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 \ $(call gb_ExternalExecutable_get_dependencies,xsltproc) @@ -201,7 +209,7 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/bookmarks.part : \ RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),100,$(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' \ - | while read xhp; do \ + | { rm -f $@.good && while read xhp; do \ $(call gb_ExternalExecutable_get_command,xsltproc) \ --stringparam app $(APP) \ --stringparam Language $(HELP_LANG) \ @@ -210,9 +218,10 @@ $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/bookmarks.part : \ --stringparam productversion "$(PRODUCTVERSION)" \ $(SRCDIR)/helpcontent2/help3xsl/get_bookmark.xsl \ $$xhp \ - ; done \ + ; done && touch $@.good; } \ | sort -k3b -t\> -s \ | awk 'NF' \ + && rm $@.good \ ) > $@ \ && rm "$$RESPONSEFILE" \ ) |