diff options
author | Bruce Momjian <bruce@momjian.us> | 2024-12-03 18:27:41 -0500 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2024-12-03 18:27:41 -0500 |
commit | 498f130756914e1bc3125ddfc7e5c86f38ded8e8 (patch) | |
tree | 7a76b5759d58cd859d16c19683d643feb24ce762 /doc/src | |
parent | 8b318a168a5830770722c501d7db0607649b3c33 (diff) | |
download | postgresql-498f130756914e1bc3125ddfc7e5c86f38ded8e8.tar.gz postgresql-498f130756914e1bc3125ddfc7e5c86f38ded8e8.zip |
Fix Makefile so invalid characters warning preserves error code
Fix for commit e4c8865196f.
Reported-by: Peter Eisentraut
Discussion: https://postgr.es/m/88cb6ecf-22bb-431e-974b-1cd236a80364@eisentraut.org
Backpatch-through: master
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/Makefile | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile index 4a08b6f433e..9d52715ff4b 100644 --- a/doc/src/sgml/Makefile +++ b/doc/src/sgml/Makefile @@ -156,9 +156,11 @@ XSLTPROC_FO_FLAGS += --stringparam img.src.path '$(srcdir)/' $(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type USletter -o $@ $^ %.pdf: %.fo $(ALL_IMAGES) - LANG=C $(FOP) -fo $< -pdf $@ 2>&1 | \ - awk 'BEGIN { warn = 0 } { print } /not available in font/ { warn = 1 } \ - END { if (warn != 0) print("\nFound characters that cannot be output in the PDF document; see README.non-ASCII") }' 1>&2 + @# There is no easy way to pipe output and capture its return code, so output a special string on failure. + { LANG=C $(FOP) -fo $< -pdf $@ 2>&1; [ "$$?" -ne 0 ] && echo "FOP_ERROR"; } | \ + awk 'BEGIN { warn = 0 } ! /^FOP_ERROR$$/ { print } /not available in font/ { warn = 1 } \ + END { if (warn != 0) print("\nFound characters that cannot be output in the PDF document; see README.non-ASCII"); \ + if ($$0 ~ /^FOP_ERROR$$/) { exit 1} }' 1>&2 ## |