Kaydet (Commit) 4e4ea4bc authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Improve gb_Helper_print_on_error, and use in a CustomTarget

* always wrap the sub-command in ( ... )

* if no 2nd arg is given, use a temp file

Change-Id: I7b43214dda1e4f8ee5e9b9a7310d58adee2a6500
üst b004bf7f
......@@ -21,10 +21,10 @@ $(call gb_CustomTarget_get_workdir,i18npool/localedata)/localedata_$(1).cxx : \
$(call gb_Executable_get_runtime_dependencies,saxparser)
$$(call gb_Output_announce,$$(subst $(WORKDIR)/,,$$@),$(true),SAX,1)
$$(call gb_Helper_abbreviate_dirs, \
$$(call gb_Helper_execute,saxparser) $(1) $$< $$@.tmp \
-env:LO_LIB_DIR=$(call gb_Helper_make_url,$(INSTROOT_FOR_BUILD)/$(LIBO_LIB_FOLDER)) \
-env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target_for_build,saxparser)) \
$(if $(findstring s,$(MAKEFLAGS)),> /dev/null 2>&1) && \
$$(call gb_Helper_print_on_error, \
$$(call gb_Helper_execute,saxparser) $(1) $$< $$@.tmp \
-env:LO_LIB_DIR=$(call gb_Helper_make_url,$(INSTROOT_FOR_BUILD)/$(LIBO_LIB_FOLDER)) \
-env:URE_MORE_SERVICES=$(call gb_Helper_make_url,$(call gb_Rdb_get_target_for_build,saxparser))) && \
sed 's/\(^.*get[^;]*$$$$\)/SAL_DLLPUBLIC_EXPORT \1/' $$@.tmp > $$@ && \
rm $$@.tmp)
......
......@@ -286,7 +286,13 @@ $(if $(filter $(1),$(BUILD_TYPE_FOR_HOST)),$(2))
endef
define gb_Helper_print_on_error
$(if $(gb_QUIET_EXTERNAL),( $(1) ) > $(2) 2>&1 || ( cat $(2) && false ),$(1) )
$(if $(gb_QUIET_EXTERNAL), \
$(if $(2), \
( ( $(1) ) > $(2) 2>&1 || ( cat $(2) && false ) ), \
( TEMPFILE=$(shell $(gb_MKTEMP)) && ( $(1) ) > $$TEMPFILE 2>&1 \
&& rm $$TEMPFILE \
|| ( cat $$TEMPFILE && rm $$TEMPFILE && false ) )), \
( $(1) ))
endef
# vim: set noet sw=4 ts=4:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment