On 11/12/2010 11:58 PM, Ralf Wildenhues wrote:
> Hello,
>
> * Eric Blake wrote on Fri, Nov 12, 2010 at 10:40:25PM CET:
>> On 11/12/2010 02:35 PM, Paul Eggert wrote:
>>> On 11/12/2010 12:50 PM, Eric Blake wrote:
>>>> + s/^\([0-9]\{1,\}\(\.[.a-z0-9-]*\)\)*.*/\1/
>>>
>>> Surely that is a typo. The "*\)\)*" should be a "*\)*\)".
>>
>> Aargh - I tested on one machine, but committed on another. Typo is now
>> fixed.
>
> But the following limitations from autoconf.info still apply:
>
> Nested parentheses in patterns (e.g., `\(\(a*\)b*)\)') are quite
> portable to current hosts, but was not supported by some ancient
> `sed' implementations like SVR3.
>
> Some `sed' implementations, e.g., Solaris, restrict the special
> role of the asterisk `*' to one-character regular expressions and
> back-references, and the special role of interval expressions
> `\{M\}', `\{M,\}', or `\{M,N\}' to one-character regular
> expressions. This may lead to unexpected behavior:
>
> You can probably ignore the first, but not the second.
Thanks for the reminder :(
$ echo 'abc' | /bin/sed -n '/b\{1\}/ p'
abc
$ echo 'abc' | /bin/sed -n '/[bc]\{1\}/ p'
abc
$ echo 'abc' | /bin/sed -n '/\(b\)\{1\}/ p'
$
But for bootstrap's point of view, it seems like it would be easier to
find a working sed than to try and rewrite get_version to work around
that Solaris brain-damage.
$ echo 'abc' | /usr/xpg4/bin/sed -n '/\(b\)\{1,\}/ p'
abc
--
Eric Blake [email protected] +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
