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

"Gary V. Vaughan" <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
On Sep 6, 2007, at 2:19 PM, Ralf Wildenhues wrote:
> Hi Gary,

Hallo Ralf,

> Gary V. Vaughan <gary <at> gnu.org> writes:
>>
>>   	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?

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
-- 
   ())_.              Email me: [email protected]
   ( '/           Read my blog: http://blog.azazil.net
   / )=         ...and my book: http://sources.redhat.com/autobook
`(_~)_      Join my AGLOCO Network: http://www.agloco.com/r/BBBS7912

_______________________________________________
M4-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/m4-patches
PGP.sig (application/pgp-signature, 186 B) - not displayed
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.