libctf: update regexp to allow makeinfo to build document

Message ID OS3P286MB2152AC3F96A88680022D57ADF0C29@OS3P286MB2152.JPNP286.PROD.OUTLOOK.COM
State Committed
Headers
Series libctf: update regexp to allow makeinfo to build document |

Commit Message

Enze Li Jan. 13, 2023, 2:42 p.m. UTC
  While trying to build gdb on latest openSUSE Tumbleweed, I noticed the
following warning,

 checking for makeinfo... makeinfo --split-size=5000000
 configure: WARNING:
 *** Makeinfo is too old. Info documentation will not be built.

then I checked the version of makeinfo, it said,
======
$ makeinfo --version
texi2any (GNU texinfo) 7.0.1

Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
======

After digging a little bit, it became quite obvious that a dot is
missing in regexp that makes it impossible to match versions higher than
7.0.

libctf/ChangeLog:

	* configure: Regenerated.
	* configure.ac: Update regexp to match versions higher than 7.0.
---
 libctf/configure    | 2 +-
 libctf/configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


base-commit: 6f9f448118eaeaf006f867a25699aef7d8c72770
  

Comments

Eli Zaretskii Jan. 13, 2023, 3:05 p.m. UTC | #1
> Cc: gdb-patches@sourceware.org,
> 	enze.li@gmx.com
> Date: Fri, 13 Jan 2023 22:42:32 +0800
> From: Enze Li via Gdb-patches <gdb-patches@sourceware.org>
> 
> While trying to build gdb on latest openSUSE Tumbleweed, I noticed the
> following warning,
> 
>  checking for makeinfo... makeinfo --split-size=5000000
>  configure: WARNING:
>  *** Makeinfo is too old. Info documentation will not be built.
> 
> then I checked the version of makeinfo, it said,
> ======
> $ makeinfo --version
> texi2any (GNU texinfo) 7.0.1
> 
> Copyright (C) 2022 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> ======
> 
> After digging a little bit, it became quite obvious that a dot is
> missing in regexp that makes it impossible to match versions higher than
> 7.0.

Thanks.

> libctf/ChangeLog:
> 
> 	* configure: Regenerated.
> 	* configure.ac: Update regexp to match versions higher than 7.0.
> ---
>  libctf/configure    | 2 +-
>  libctf/configure.ac | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libctf/configure b/libctf/configure
> index c22f7dffd2c..e9f7125edea 100755
> --- a/libctf/configure
> +++ b/libctf/configure
> @@ -14864,7 +14864,7 @@ esac
>      # We require texinfo to be 6.3 or later, for a working synindex
>      # and validatemenus: otherwise we fall back to /bin/true.
>      if ${MAKEINFO} --version \
> -       | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then
> +       | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]\.[0-9])' >/dev/null 2>&1; then
>        build_info=yes
>      else
>          build_info=
> diff --git a/libctf/configure.ac b/libctf/configure.ac
> index 1d0cf4d0fa5..4bc75736542 100644
> --- a/libctf/configure.ac
> +++ b/libctf/configure.ac
> @@ -184,7 +184,7 @@ changequote(,)
>      # We require texinfo to be 6.3 or later, for a working synindex
>      # and validatemenus: otherwise we fall back to /bin/true.
>      if ${MAKEINFO} --version \
> -       | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then
> +       | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]\.[0-9])' >/dev/null 2>&1; then
>        build_info=yes
>      else
>          build_info=

IMO, this solution has the same problem: it will stop working when
Texinfo 10.1 will be released.  I think the solution should be to use

  egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9]?)'

That is, we don't care about the minor version for Texinfo > 6.9, we
only care about the major version.
  
Andreas Schwab Jan. 13, 2023, 3:36 p.m. UTC | #2
On Jan 13 2023, Eli Zaretskii via Gdb-patches wrote:

> IMO, this solution has the same problem: it will stop working when
> Texinfo 10.1 will be released.  I think the solution should be to use
>
>   egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9]?)'

Since the match is not anchored, the trailing [0-9]? pattern is redundant.
  
Eli Zaretskii Jan. 13, 2023, 3:44 p.m. UTC | #3
> From: Andreas Schwab <schwab@linux-m68k.org>
> Cc: Enze Li <enze.li@hotmail.com>,  Eli Zaretskii <eliz@gnu.org>,
>   binutils@sourceware.org,  enze.li@gmx.com
> Date: Fri, 13 Jan 2023 16:36:09 +0100
> 
> On Jan 13 2023, Eli Zaretskii via Gdb-patches wrote:
> 
> > IMO, this solution has the same problem: it will stop working when
> > Texinfo 10.1 will be released.  I think the solution should be to use
> >
> >   egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9]?)'
> 
> Since the match is not anchored, the trailing [0-9]? pattern is redundant.

Right.  But I now actually think we need something different, like

  egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])'
  
Enze Li Jan. 14, 2023, 4:36 a.m. UTC | #4
On Fri, Jan 13 2023 at 10:44:36 AM -0500, Eli Zaretskii wrote:

>> From: Andreas Schwab <schwab@linux-m68k.org>
>> Cc: Enze Li <enze.li@hotmail.com>,  Eli Zaretskii <eliz@gnu.org>,
>>   binutils@sourceware.org,  enze.li@gmx.com
>> Date: Fri, 13 Jan 2023 16:36:09 +0100
>> 
>> On Jan 13 2023, Eli Zaretskii via Gdb-patches wrote:
>> 
>> > IMO, this solution has the same problem: it will stop working when
>> > Texinfo 10.1 will be released.  I think the solution should be to use
>> >
>> >   egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9]?)'
>> 
>> Since the match is not anchored, the trailing [0-9]? pattern is redundant.
>
> Right.  But I now actually think we need something different, like
>
>   egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])'

Hi Eli,

Thanks for your swift reply.

I've tested the following possible version numbers,

6.2.1, 6.3.1, 6.9.1, 7.0.1, 9.9.1, 10.1.1, 60.1.1, 199.1.1, 999.1.1

with the command like this:

$ echo "(GNU texinfo) 6.2" | \
  egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])'

All of these tests are Okay.

I sent a new version to the list, ok for the trunk?

Best Regards,
Enze
  
Eli Zaretskii Jan. 14, 2023, 7:36 a.m. UTC | #5
> From: Enze Li <enze.li@hotmail.com>
> Cc: Andreas Schwab <schwab@linux-m68k.org>,  gdb-patches@sourceware.org,
>   binutils@sourceware.org,  enze.li@gmx.com
> Date: Sat, 14 Jan 2023 12:36:41 +0800
> 
> On Fri, Jan 13 2023 at 10:44:36 AM -0500, Eli Zaretskii wrote:
> 
> >> From: Andreas Schwab <schwab@linux-m68k.org>
> >> Cc: Enze Li <enze.li@hotmail.com>,  Eli Zaretskii <eliz@gnu.org>,
> >>   binutils@sourceware.org,  enze.li@gmx.com
> >> Date: Fri, 13 Jan 2023 16:36:09 +0100
> >> 
> >> On Jan 13 2023, Eli Zaretskii via Gdb-patches wrote:
> >> 
> >> > IMO, this solution has the same problem: it will stop working when
> >> > Texinfo 10.1 will be released.  I think the solution should be to use
> >> >
> >> >   egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9]?)'
> >> 
> >> Since the match is not anchored, the trailing [0-9]? pattern is redundant.
> >
> > Right.  But I now actually think we need something different, like
> >
> >   egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])'
> 
> Hi Eli,
> 
> Thanks for your swift reply.
> 
> I've tested the following possible version numbers,
> 
> 6.2.1, 6.3.1, 6.9.1, 7.0.1, 9.9.1, 10.1.1, 60.1.1, 199.1.1, 999.1.1
> 
> with the command like this:
> 
> $ echo "(GNU texinfo) 6.2" | \
>   egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]|[1-6][0-9])'
> 
> All of these tests are Okay.
> 
> I sent a new version to the list, ok for the trunk?

It's fine by me, but I cannot approve changes to all the repositories
by myself.  So please wait for others to approve the change before you
install it.
  

Patch

diff --git a/libctf/configure b/libctf/configure
index c22f7dffd2c..e9f7125edea 100755
--- a/libctf/configure
+++ b/libctf/configure
@@ -14864,7 +14864,7 @@  esac
     # We require texinfo to be 6.3 or later, for a working synindex
     # and validatemenus: otherwise we fall back to /bin/true.
     if ${MAKEINFO} --version \
-       | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then
+       | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]\.[0-9])' >/dev/null 2>&1; then
       build_info=yes
     else
         build_info=
diff --git a/libctf/configure.ac b/libctf/configure.ac
index 1d0cf4d0fa5..4bc75736542 100644
--- a/libctf/configure.ac
+++ b/libctf/configure.ac
@@ -184,7 +184,7 @@  changequote(,)
     # We require texinfo to be 6.3 or later, for a working synindex
     # and validatemenus: otherwise we fall back to /bin/true.
     if ${MAKEINFO} --version \
-       | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9][0-9])' >/dev/null 2>&1; then
+       | egrep 'texinfo[^0-9]*(6\.[3-9]|[7-9]\.[0-9])' >/dev/null 2>&1; then
       build_info=yes
     else
         build_info=