Gerald Pfeifer <ger...@pfeifer.com> writes:

> On Tue, 11 Apr 2023, Arsen Arsenović wrote:
>> Ah!  Good idea.  What do you think of the following?
>
> Did you intentionally not implement the following part of my suggestion
>
>    if [ x${MAKEINFO}x = xx ]; then
>    :
>
> that is, allowing to override from the command-line (or crontab)?
>
>
> And why the colons in
>
>   +    : "${MAKEINFO:=${makeinfo_git}/makeinfo}"
>   +    : "${TEXI2DVI:=${makeinfo_git}/texi2dvi}"
>   +    : "${TEXI2PDF:=${makeinfo_git}/texi2pdf}"
>
> ? I don't think we use these elsewhere. Do they serve a purpose or can we 
> omit them and keep things simpler?

(answering both the questions)

This := operator is a handy "default assign" operator.  It's a bit of an
oddity of the POSIX shell, but it works well.  The line:

  : "${foo:=bar}"

is a convenient way of spelling "if foo is unset or null, set it to
bar".  the initial ':' there serves to discard the result of this
evaluation (so that only its side effect of updating foo if necessary is
kept)

... so, the above block translates into "if makeinfo_git/makeinfo
exists, then default MAKEINFO, TEXI2DVI, TEXI2PDF to makeinfo_git/$tool,
otherwise, default them to $tool", where $tool is the respective tool
for those variables.

>
> Please let me know, and I'll see to get this (or probably an updated 
> patch) in place on gcc.gnu.org.
>
> Thanks,
> Gerald


-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature

Reply via email to