Skip to content

Commit 498f130

Browse files
committed
Fix Makefile so invalid characters warning preserves error code
Fix for commit e4c8865. Reported-by: Peter Eisentraut Discussion: https://postgr.es/m/[email protected] Backpatch-through: master
1 parent 8b318a1 commit 498f130

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/src/sgml/Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,11 @@ XSLTPROC_FO_FLAGS += --stringparam img.src.path '$(srcdir)/'
156156
$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type USletter -o $@ $^
157157

158158
%.pdf: %.fo $(ALL_IMAGES)
159-
LANG=C $(FOP) -fo $< -pdf $@ 2>&1 | \
160-
awk 'BEGIN { warn = 0 } { print } /not available in font/ { warn = 1 } \
161-
END { if (warn != 0) print("\nFound characters that cannot be output in the PDF document; see README.non-ASCII") }' 1>&2
159+
@# There is no easy way to pipe output and capture its return code, so output a special string on failure.
160+
{ LANG=C $(FOP) -fo $< -pdf $@ 2>&1; [ "$$?" -ne 0 ] && echo "FOP_ERROR"; } | \
161+
awk 'BEGIN { warn = 0 } ! /^FOP_ERROR$$/ { print } /not available in font/ { warn = 1 } \
162+
END { if (warn != 0) print("\nFound characters that cannot be output in the PDF document; see README.non-ASCII"); \
163+
if ($$0 ~ /^FOP_ERROR$$/) { exit 1} }' 1>&2
162164

163165

164166
##

0 commit comments

Comments
 (0)