Hello Bruno, * Bruno Haible wrote on Sat, Jun 23, 2007 at 02:53:41PM CEST: > Ralf Wildenhues wrote: > > Another rough pass over gnulib-tool's tendency to spawn more processes > > than it needs to. > > Why not. But why don't you concentrate on the loops of func_import when > doing that? gnulib-tool will not become measurably faster by optimizing > code that is executed only once.
Quite true. My changes were rather mechanical in the sense that I simply searched for some constructs and fixed them in the passing, using well-known other constructs from Autoconf. The fact that these introduced a bug came surprising to me, but thanks to your proofreading it now also helps to fix a bug in Autoconf itself. > > (self_abspathname): Rewrite algorithm to set it, reindent. > > Regression: PATH values with a trailing empty field, such as > PATH=/usr/bin:/bin: > are not handled correctly. [...] > (I guess you copied that idiom from somewhere, and it was already wrong > at the original place.) Yep. Patches to Autoconf and Libtool coming up on their respective lists. Patch for gnulib-tool below. > The indentation is not right: [...] Apologies. Libtool uses slightly different indenting, which I have gotten used to, and I forgot to readjust that here. OK to apply this patch to fix these issues? Cheers, Ralf 2007-06-23 Ralf Wildenhues <[EMAIL PROTECTED]> * gnulib-tool: Fix iteration over $PATH by IFS by adding `:' at the end. Fix indentation. (func_create_megatestdir): Likewise. Report by Bruno Haible. Index: gnulib-tool =================================================================== RCS file: /cvsroot/gnulib/gnulib/gnulib-tool,v retrieving revision 1.236 diff -u -r1.236 gnulib-tool --- gnulib-tool 23 Jun 2007 07:40:58 -0000 1.236 +++ gnulib-tool 23 Jun 2007 13:17:00 -0000 @@ -838,23 +838,22 @@ /*) self_abspathname="$0" ;; */*) self_abspathname=`pwd`/"$0" ;; *) - - self_abspathname= - save_IFS=$IFS - IFS=: - for d in $PATH; do + self_abspathname= + save_IFS=$IFS + IFS=: + for d in $PATH:; do + IFS=$save_IFS + test -z "$d" && d=. + if test -x "$d/$0" && test ! -d "$d/$0"; then + self_abspathname=$d/$0 + break + fi + done IFS=$save_IFS - test -z "$d" && d=. - if test -x "$d/$0" && test ! -d "$d/$0"; then - self_abspathname=$d/$0 - break + if test -z "$self_abspathname"; then + func_fatal_error "could not locate the gnulib-tool program - how did you invoke it?" fi - done - IFS=$save_IFS - if test -z "$self_abspathname"; then - func_fatal_error "could not locate the gnulib-tool program - how did you invoke it?" - fi - ;; + ;; esac while test -h "$self_abspathname"; do # Resolve symbolic link. @@ -3007,7 +3006,7 @@ -e 's,October,10,' -e 's,Oct,10,' \ -e 's,November,11,' -e 's,Nov,11,' \ -e 's,December,12,' -e 's,Dec,12,' \ - -e 's,^,00,' -e 's,^[0-9]*\([0-9][0-9] \),\1,' \ + -e 's,^,00,' -e 's,^[0-9]*\([0-9][0-9] \),\1,' \ -e 's,^\([0-9]*\) \([0-9]*\) \([0-9]*\),\3\2\1,'` (echo '#!/bin/sh' echo "CVSDATE=$cvsdate"