public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] update_web_docs_git: Add updated Texinfo to PATH
@ 2023-04-06 10:35 Arsen Arsenović
  2023-04-10 21:45 ` Gerald Pfeifer
  2023-04-10 21:49 ` Gerald Pfeifer
  0 siblings, 2 replies; 10+ messages in thread
From: Arsen Arsenović @ 2023-04-06 10:35 UTC (permalink / raw)
  To: gcc-patches; +Cc: Gerald Pfeifer, Arsen Arsenović

maintainer-scripts/ChangeLog:

	* update_web_docs_git: Add updated Texinfo to PATH
---
Hi,

I'm posting this as a ping and a patch necessary to get the wwwdocs
building with the new Texinfo version that's installed on gcc.gnu.org.
It would be nice to do this ahead of the GCC 13 release.

I must ask that whoever decides to apply/update the script tests
texi2any with a simple example, like

  echo @node Top | ~/texinfo/install-git/bin/makeinfo --html -o -

... before updating; this should be a representative enough smoke test.
You should see some HTML output with little text in it.

It might also be wise to test the script directly by using a different
WWWBASE, just in case, even though it should be safe.

Thanks in advance, have a lovely day.

 maintainer-scripts/update_web_docs_git | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/maintainer-scripts/update_web_docs_git b/maintainer-scripts/update_web_docs_git
index d44ab27c1b7..f9006b1f45b 100755
--- a/maintainer-scripts/update_web_docs_git
+++ b/maintainer-scripts/update_web_docs_git
@@ -12,7 +12,7 @@ set -e
 GITROOT=${GITROOT:-"/git/gcc.git"}
 export GITROOT
 
-PATH=/usr/local/bin:$PATH
+PATH=/home/gccadmin/texinfo/install-git/bin:/usr/local/bin:$PATH
 
 MANUALS="cpp
   cppinternals
-- 
2.40.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] update_web_docs_git: Add updated Texinfo to PATH
  2023-04-06 10:35 [PATCH] update_web_docs_git: Add updated Texinfo to PATH Arsen Arsenović
@ 2023-04-10 21:45 ` Gerald Pfeifer
  2023-04-10 22:15   ` Arsen Arsenović
  2023-04-10 21:49 ` Gerald Pfeifer
  1 sibling, 1 reply; 10+ messages in thread
From: Gerald Pfeifer @ 2023-04-10 21:45 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 507 bytes --]

On Thu, 6 Apr 2023, Arsen Arsenović wrote:
> maintainer-scripts/ChangeLog:
> 
> 	* update_web_docs_git: Add updated Texinfo to PATH

Do we really need to adjust PATH, or could we just introduce a MAKEINFO 
variable, something like

  if [ x${MAKEINFO}x = xx ]; then
    if [ -x /home/gccadmin/texinfo/install-git/bin/makeinfo ]; then
      MAKEINFO=/home/gccadmin/texinfo/install-git/bin/makeinfo;
    else
      MAKEINFO=makeinfo
    fi
  fi

?

(This also still allows overriding upon invocation.)

Gerald

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] update_web_docs_git: Add updated Texinfo to PATH
  2023-04-06 10:35 [PATCH] update_web_docs_git: Add updated Texinfo to PATH Arsen Arsenović
  2023-04-10 21:45 ` Gerald Pfeifer
@ 2023-04-10 21:49 ` Gerald Pfeifer
  1 sibling, 0 replies; 10+ messages in thread
From: Gerald Pfeifer @ 2023-04-10 21:49 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

On Thu, 6 Apr 2023, Arsen Arsenović wrote:
> I must ask that whoever decides to apply/update the script tests
> texi2any with a simple example, like
> 
>   echo @node Top | ~/texinfo/install-git/bin/makeinfo --html -o -
> 
> ... before updating; this should be a representative enough smoke test.
> You should see some HTML output with little text in it.

Yep, and one warning:

  -: warning: must specify a title with a title command or @top

The following then proceeds without warning and the output looks fine:

  printf "@title foo\n@node Top" | /home/gccadmin/texinfo/install-git/bin/makeinfo  --html -o -

Gerald

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] update_web_docs_git: Add updated Texinfo to PATH
  2023-04-10 21:45 ` Gerald Pfeifer
@ 2023-04-10 22:15   ` Arsen Arsenović
  2023-04-14 19:29     ` Gerald Pfeifer
  0 siblings, 1 reply; 10+ messages in thread
From: Arsen Arsenović @ 2023-04-10 22:15 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 671 bytes --]


Gerald Pfeifer <gerald@pfeifer.com> writes:

> On Thu, 6 Apr 2023, Arsen Arsenović wrote:
>> maintainer-scripts/ChangeLog:
>> 
>> 	* update_web_docs_git: Add updated Texinfo to PATH
>
> Do we really need to adjust PATH, or could we just introduce a MAKEINFO 
> variable, something like
>
>   if [ x${MAKEINFO}x = xx ]; then
>     if [ -x /home/gccadmin/texinfo/install-git/bin/makeinfo ]; then
>       MAKEINFO=/home/gccadmin/texinfo/install-git/bin/makeinfo;
>     else
>       MAKEINFO=makeinfo
>     fi
>   fi
>
> ?
>
> (This also still allows overriding upon invocation.)
>
> Gerald

Ah!  Good idea.  What do you think of the following?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: [PATCH] update_web_docs_git: Allow setting TEXI2*, add git build --]
[-- Type: text/x-patch, Size: 2119 bytes --]

From ba00aa3882b7e0a5fa247f9fa824474e3ddc8102 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
Date: Thu, 6 Apr 2023 12:20:57 +0200
Subject: [PATCH] update_web_docs_git: Allow setting TEXI2*, add git build
 default

maintainer-scripts/ChangeLog:

	* update_web_docs_git: Add a mechanism to override makeinfo,
	texi2dvi and texi2pdf, and default them to
	/home/gccadmin/texinfo/install-git/bin/${tool}, if present.
---
 maintainer-scripts/update_web_docs_git | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/maintainer-scripts/update_web_docs_git b/maintainer-scripts/update_web_docs_git
index d44ab27c1b7..c651e567424 100755
--- a/maintainer-scripts/update_web_docs_git
+++ b/maintainer-scripts/update_web_docs_git
@@ -14,6 +14,17 @@ export GITROOT
 
 PATH=/usr/local/bin:$PATH
 
+makeinfo_git=/home/gccadmin/texinfo/install-git/bin/
+if [ -x "${makeinfo_git}"/makeinfo ]; then
+    : "${MAKEINFO:=${makeinfo_git}/makeinfo}"
+    : "${TEXI2DVI:=${makeinfo_git}/texi2dvi}"
+    : "${TEXI2PDF:=${makeinfo_git}/texi2pdf}"
+else
+    : "${MAKEINFO:=makeinfo}"
+    : "${TEXI2DVI:=texi2dvi}"
+    : "${TEXI2PDF:=texi2pdf}"
+fi
+
 MANUALS="cpp
   cppinternals
   fastjar
@@ -174,10 +185,10 @@ for file in $MANUALS; do
     elif [ "$file" = "gnat_ugn" ]; then
       includes="$includes -I gcc/gcc/ada -I gcc/gcc/ada/doc/gnat_ugn"
     fi
-    makeinfo --html -c CONTENTS_OUTPUT_LOCATION=inline --css-ref $CSS $includes -o ${file} ${filename}
+    "${MAKEINFO}" --html -c CONTENTS_OUTPUT_LOCATION=inline --css-ref $CSS $includes -o ${file} ${filename}
     tar cf ${file}-html.tar ${file}/*.html
-    texi2dvi $includes -o ${file}.dvi ${filename} </dev/null >/dev/null && dvips -o ${file}.ps ${file}.dvi
-    texi2pdf $includes -o ${file}.pdf ${filename} </dev/null
+    "${TEXI2DVI}" $includes -o ${file}.dvi ${filename} </dev/null >/dev/null && dvips -o ${file}.ps ${file}.dvi
+    "${TEXI2PDF}" $includes -o ${file}.pdf ${filename} </dev/null
     mkdir -p $DOCSDIR/$file
   fi
 done
-- 
2.38.0


[-- Attachment #1.3: Type: text/plain, Size: 96 bytes --]


... since the other tools are siblings.

Thanks for the smoke test!
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] update_web_docs_git: Add updated Texinfo to PATH
  2023-04-10 22:15   ` Arsen Arsenović
@ 2023-04-14 19:29     ` Gerald Pfeifer
  2023-04-14 20:25       ` Arsen Arsenović
  0 siblings, 1 reply; 10+ messages in thread
From: Gerald Pfeifer @ 2023-04-14 19:29 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 682 bytes --]

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?


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

Thanks,
Gerald

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] update_web_docs_git: Add updated Texinfo to PATH
  2023-04-14 19:29     ` Gerald Pfeifer
@ 2023-04-14 20:25       ` Arsen Arsenović
  2023-04-20 20:14         ` Gerald Pfeifer
  0 siblings, 1 reply; 10+ messages in thread
From: Arsen Arsenović @ 2023-04-14 20:25 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]


Gerald Pfeifer <gerald@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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 251 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] update_web_docs_git: Add updated Texinfo to PATH
  2023-04-14 20:25       ` Arsen Arsenović
@ 2023-04-20 20:14         ` Gerald Pfeifer
  2023-04-20 20:53           ` Arsen Arsenović
  0 siblings, 1 reply; 10+ messages in thread
From: Gerald Pfeifer @ 2023-04-20 20:14 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]

Hi Arsen,

On Fri, 14 Apr 2023, Arsen Arsenović wrote:
>> 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)?
> (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)

I understand, just am wondering whether and why the : is required? I 
don't think we are using this construct anywhere else?

(I was aware of the ${foo:=bar} syntax, just caught up by you pushing
that part of the logic to the lowest level whereas I had it at the top
level. That's purely on me.)

Please go ahead and push this (or a variant without the : commands) and
I'll then pick it up from there.

Gerald

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] update_web_docs_git: Add updated Texinfo to PATH
  2023-04-20 20:14         ` Gerald Pfeifer
@ 2023-04-20 20:53           ` Arsen Arsenović
  2023-04-21  7:00             ` Gerald Pfeifer
  0 siblings, 1 reply; 10+ messages in thread
From: Arsen Arsenović @ 2023-04-20 20:53 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1429 bytes --]


Gerald Pfeifer <gerald@pfeifer.com> writes:

> Hi Arsen,
>
> On Fri, 14 Apr 2023, Arsen Arsenović wrote:
>>> 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)?
>> (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)
>
> I understand, just am wondering whether and why the : is required? I 
> don't think we are using this construct anywhere else?

Without them, this would happen:

  ~$ "${foo:=foo}"
  bash: foo: command not found
  ~ 127 $ unset foo
  ~$ echo "${foo:=foo}"
  foo
  ~$ 

> (I was aware of the ${foo:=bar} syntax, just caught up by you pushing
> that part of the logic to the lowest level whereas I had it at the top
> level. That's purely on me.)
>
> Please go ahead and push this (or a variant without the : commands) and
> I'll then pick it up from there.

Thank you!  Hopefully we get this just in time for 13 :)

Pushed.
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] update_web_docs_git: Add updated Texinfo to PATH
  2023-04-20 20:53           ` Arsen Arsenović
@ 2023-04-21  7:00             ` Gerald Pfeifer
  2023-04-21  8:46               ` Arsen Arsenović
  0 siblings, 1 reply; 10+ messages in thread
From: Gerald Pfeifer @ 2023-04-21  7:00 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

On Thu, 20 Apr 2023, Arsen Arsenović wrote:
>> I understand, just am wondering whether and why the : is required? I 
>> don't think we are using this construct anywhere else?
> Without them, this would happen:
> 
>   ~$ "${foo:=foo}"
>   bash: foo: command not found
>   ~ 127 $ unset foo
>   ~$ echo "${foo:=foo}"
>   foo
>   ~$ 

Ah, of course!

That's why I tend to use FOO=${FOO-barbar} in such cases - which is a tad 
more characters. :)

> Thank you!  Hopefully we get this just in time for 13 :)

The release is currently planned for the 26th and the udpated script is 
now live.

I just ran it and things seem to work just fine. Do you spot anything
unexpected?

Gerald

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH] update_web_docs_git: Add updated Texinfo to PATH
  2023-04-21  7:00             ` Gerald Pfeifer
@ 2023-04-21  8:46               ` Arsen Arsenović
  0 siblings, 0 replies; 10+ messages in thread
From: Arsen Arsenović @ 2023-04-21  8:46 UTC (permalink / raw)
  To: Gerald Pfeifer; +Cc: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 884 bytes --]


Gerald Pfeifer <gerald@pfeifer.com> writes:

> On Thu, 20 Apr 2023, Arsen Arsenović wrote:
>>> I understand, just am wondering whether and why the : is required? I 
>>> don't think we are using this construct anywhere else?
>> Without them, this would happen:
>> 
>>   ~$ "${foo:=foo}"
>>   bash: foo: command not found
>>   ~ 127 $ unset foo
>>   ~$ echo "${foo:=foo}"
>>   foo
>>   ~$ 
>
> Ah, of course!
>
> That's why I tend to use FOO=${FOO-barbar} in such cases - which is a tad 
> more characters. :)
>
>> Thank you!  Hopefully we get this just in time for 13 :)
>
> The release is currently planned for the 26th and the udpated script is 
> now live.

Perfect \o/

> I just ran it and things seem to work just fine. Do you spot anything
> unexpected?

Seems perfect, thank you!

Have a lovely day!  :)

> Gerald


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-04-21  8:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 10:35 [PATCH] update_web_docs_git: Add updated Texinfo to PATH Arsen Arsenović
2023-04-10 21:45 ` Gerald Pfeifer
2023-04-10 22:15   ` Arsen Arsenović
2023-04-14 19:29     ` Gerald Pfeifer
2023-04-14 20:25       ` Arsen Arsenović
2023-04-20 20:14         ` Gerald Pfeifer
2023-04-20 20:53           ` Arsen Arsenović
2023-04-21  7:00             ` Gerald Pfeifer
2023-04-21  8:46               ` Arsen Arsenović
2023-04-10 21:49 ` Gerald Pfeifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).