[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sr #110796] libtool-2.4.7/build-aux/git-version-gen uses kind of a
From: |
Nick Bowler |
Subject: |
Re: [sr #110796] libtool-2.4.7/build-aux/git-version-gen uses kind of a hack |
Date: |
Wed, 7 Dec 2022 21:25:31 -0500 |
On 2022-12-07, anonymous <INVALID.NOREPLY@gnu.org> wrote:
[...]
> On an elderly Mac with PPC Mac OS X 10.4.11, Tiger, this was reported:
>
> expr: brackets ([ ]) not balanced
>
> It comes from this line
>
> 76 year=`expr "$scriptversion" : '\([^-]*\)'`
>
> On two more up-to-date intel Macs expr worked correctly. I can make another
> test on PPC Mac OS X 10.5.8, Leopard.
FWIW this specific problem with Mac OS expr, as well as a possible
workaround, is discussed in the portable shell programming section
of the Autoconf manual[1]:
On Mac OS X 10.4, expr mishandles the pattern ‘[^-]’ in some cases.
For example, the command
expr Xpowerpc-apple-darwin8.1.0 : 'X[^-]*-[^-]*-\(.*\)'
outputs ‘apple-darwin8.1.0’ rather than the correct ‘darwin8.1.0’.
This particular case can be worked around by substituting ‘[^--]’
for ‘[^-]’.
[1]
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.71/autoconf.html#index-expr-1
Cheers,
Nick