aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2024-12-04 14:37:24 -0500
committerBruce Momjian <bruce@momjian.us>2024-12-04 14:37:24 -0500
commit24c1c6338719e4de1dd5f045418e64957781c595 (patch)
tree1ebf13d864a6cb397cf592ec462a4536d49d7087
parentdfbb092cff70ee4d4084b7e4e57228a89ff4f9f8 (diff)
downloadpostgresql-24c1c6338719e4de1dd5f045418e64957781c595.tar.gz
postgresql-24c1c6338719e4de1dd5f045418e64957781c595.zip
Return actual error code from FOP failure in PDF build
Previously we returned "1" on error. Improvement on 77c189cdafe. Backpatch-through: master
-rw-r--r--doc/src/sgml/Makefile9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/src/sgml/Makefile b/doc/src/sgml/Makefile
index 8475d9e965f..076b12898eb 100644
--- a/doc/src/sgml/Makefile
+++ b/doc/src/sgml/Makefile
@@ -155,12 +155,13 @@ XSLTPROC_FO_FLAGS += --stringparam img.src.path '$(srcdir)/'
%-US.fo: stylesheet-fo.xsl %-full.xml
$(XSLTPROC) $(XMLINCLUDE) $(XSLTPROCFLAGS) $(XSLTPROC_FO_FLAGS) --stringparam paper.type USletter -o $@ $^
+# There is no easy way to pipe output and capture its return code,
+# so add a final line to report the return code.
%.pdf: %.fo $(ALL_IMAGES)
- @# 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 } \
+ { LANG=C $(FOP) -fo $< -pdf $@ 2>&1; echo "FOP_RETURN $$?"; } | \
+ $(AWK) 'BEGIN { warn = 0 } $$1 != "FOP_RETURN" { 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
+ if ($$2 != 0) { exit $$2} }' 1>&2
##