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/88cb6ecf-22bb-431e-974b-1cd236a80364@eisentraut.org 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

Lines changed: 5 additions & 3 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy