[sr #110796] libtool-2.4.7/build-aux/git-version-gen uses kind of a hack

2022-12-07 Thread anonymous
URL:
  

 Summary: libtool-2.4.7/build-aux/git-version-gen uses kind of
a hack
 Project: GNU Libtool
   Submitter: None
   Submitted: Wed 07 Dec 2022 11:26:55 PM UTC
Category: None
Priority: 5 - Normal
Severity: 3 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: peter_dyba...@web.de
 Open/Closed: Open
 Discussion Lock: Any
Operating System: Mac OS


___

Follow-up Comments:


---
Date: Wed 07 Dec 2022 11:26:55 PM UTC By: Anonymous
Hello!

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.

--

Pete







___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




Re: [sr #110796] libtool-2.4.7/build-aux/git-version-gen uses kind of a hack

2022-12-07 Thread Nick Bowler
On 2022-12-07, anonymous  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