Re: FYI: fix-bootstrap-translation-download-on-darwin

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches,gmane.comp.sysutils.autoconf.general
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adding autoconf, replies can drop m4-patches

According to Gary V. Vaughan on 9/11/2007 1:15 PM:

Hi Gary,

>>>
>>>       Work around a bug in darwin's awk:
>>
>>>       (func_get_translations): The first awk script mangles the last
>>>       entry passed to it for at least the awk implementation shipped
>>>       with Darwin 8.10.1.  Capture $3 into a variable too to work-
>>>       around that problem.
>>
>> Could you be bothered to explain what this bug does?  I don't quite
>> understand from the patch nor the description.  Should it be listed
>> in the Autoconf shell portability section?

I don't see this problem mentioned in autoconf.texi, so it looks like we
have some editing to do...

> 
> Sure.
> 
> $ cat in
> cs:1.4o:../PO-files
> da:1.4o:../PO-files
> de:1.4o:../PO-files
> el:1.4n:../PO-files
> el:1.4o:../PO-files
> fr:1.4o:../PO-files
> 
> 
> # Before the patch (note the last line of output):
> 
> $ cat in | /opt/local/bin/gawk -F: '
>>   { if (lang && $1 != lang) print lang, ver, $3 }
>>   { lang = $1; ver = $2 }
>>   END { if (lang) print lang, ver, $3 }'
> cs 1.4o ../PO-files
> da 1.4o ../PO-files
> de 1.4o ../PO-files
> el 1.4o ../PO-files
> fr 1.4o ../PO-files
> $ cat in | /usr/bin/awk -F: '
>>   { if (lang && $1 != lang) print lang, ver, $3 }
>>   { lang = $1; ver = $2 }
>>   END { if (lang) print lang, ver, $3 }'
> cs 1.4o ../PO-files
> da 1.4o ../PO-files
> de 1.4o ../PO-files
> el 1.4o ../PO-files
> fr 1.4o
> 
> 
> # After the patch:
> 
> $ cat in | /opt/local/bin/gawk -F: '
>>   { if (lang && $1 != lang) print lang, ver, subdir }
>>   { lang = $1; ver = $2; subdir = $3 }
>>   END { if (lang) print lang, ver, subdir }'
> cs 1.4o ../PO-files
> da 1.4o ../PO-files
> de 1.4o ../PO-files
> el 1.4o ../PO-files
> fr 1.4o ../PO-files
> $ cat in | /usr/bin/awk -F: '
>>   { if (lang && $1 != lang) print lang, ver, subdir }
>>   { lang = $1; ver = $2; subdir = $3 }
>>   END { if (lang) print lang, ver, subdir }'
> cs 1.4o ../PO-files
> da 1.4o ../PO-files
> de 1.4o ../PO-files
> el 1.4o ../PO-files
> fr 1.4o ../PO-files
> 
> It appears that only gawk saves $3 from the last input line for use in
> the END clause, where darwin awk (maybe others too, I haven't looked
> elsewhere) discards it.
> 
> Cheers,
>     Gary
> 
> 

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG6IvD84KuGfSFAYARAlQPAJ974dndX8dV2dPNjua3qbbA85ouVgCbBw2x
5fowSIV8JMgtWu6y4RlHDRI=
=hBLF
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.