Re: Doc: typo in config.sgml

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: nagata(at)sraoss(dot)co(dot)jp, peter(at)eisentraut(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us, daniel(at)yesql(dot)se, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Doc: typo in config.sgml
Date: 2024-11-26 16:39:33
Message-ID: Z0X5xYJ_dvkREogb@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 26, 2024 at 06:25:13PM +0900, Tatsuo Ishii wrote:
> I have looked into the patches.
> > %.pdf: %.fo $(ALL_IMAGES)
> > - $(FOP) -fo $< -pdf $@
> > + CLANG=C $(FOP) -fo $< -pdf $@ 2>&1 | \
>
> Shouldn't "CLANG" be "LANG"?

Yes, probably.

> > + awk 'BEGIN{err=0}{print}/not available in font/{err=1}END{exit err}' 1>&2 || \
> > + (echo "Found characters that cannot be displayed in PDF" 1>&2; exit 1)
>
> Currently "make postgres*.pdf" generates the pdf file even if there's
> a "not available in font" error while generating it. With the patch
> the pdf file is removed in this case. I'm not sure if this is an
> improvement because there's no way to generate such a pdf file if
> there's such a warning. Printing "Found characters that cannot be
> displayed in PDF" is good, but I'd prefer let users decide whether
> they retain or remove the pdf file.

Looking at the patch:

%.pdf: %.fo $(ALL_IMAGES)
- $(FOP) -fo $< -pdf $@
+ CLANG=C $(FOP) -fo $< -pdf $@ 2>&1 | \
+ awk 'BEGIN{err=0}{print}/not available in font/{err=1}END{exit err}' 1>&2 || \
+ (echo "Found characters that cannot be displayed in PDF" 1>&2; exit 1)

it returns an error if it sees a "not available in font" error, and
since src/Makefile.global has .DELETE_ON_ERROR, and this is included in
doc/src/sgml/Makefile, the file is deleted on the awk 'exit' error.

If there are invalid characters in the PDF, shouldn't the PDF be
considered invalid and removed from the build? To allow such builds to
keep those PDF files, we would need to probably override
.DELETE_ON_ERROR, but it would have to be done in a way that an error
exit from FOP would still remove the PDF file. I think we would have to
have FOP write to a temporary file, and then override the
.DELETE_ON_ERROR just for the check for the string "not available in
font" text in the temporary file.

Do we want to add this complexity?

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

When a patient asks the doctor, "Am I going to die?", he means
"Am I going to die soon?"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-11-26 16:43:02 Re: Doc: typo in config.sgml
Previous Message Tom Lane 2024-11-26 16:35:56 Re: Misleading "epoll_create1 failed: Too many open files"