This patch series is a repost and update of the unapplied parts of <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/16147> plus a couple of new patches; prompted by <http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20351/focus=20370>.
The first two patches, taken together, have a net effect of 10-20% speedup on normal gnulib-tool usage. The third patch is a minor peephole optimization. Simon reported this to be very slow: gnulib-tool --test --with-tests (or s/--test/--create-testdir/, that is fairly irrelevant) Here, execution time is dominated by the license compatibility checking code in func_create_testdir. The fourth patch in this series speeds up this check from something like 4.5 min to 26s on my system, but it also changes the semantics of the test a bit; see the patch for discussion. The last patch in this series fixes some of the fallout. All in all, this series should cut well over half the gnulib-tool running time for Simon. It has been casually tested to work on AIX 5.3 ksh FreeBSD sh GNU/Linux bash, dash, ksh, ksh93 HP-UX 11.23/PA ksh Solaris 10 ksh Tru64 5.1 ksh It exposes a segfault with (unmaintained) pdksh on GNU/Linux. I don't think we need to cater to this. IRIX 6.5 sed has too many problems for gnulib-tool both without and with this patch series, but using GNU sed there seems to work fine. I'm willing to rework the patches for suggested/required changes, and I'd volunteer to maintain the code, if that helps. Thanks. The patches are posted with git format-patch, so it should be possible to apply them all at once from a pipe to 'git am -3' (the commit message ends after the '---'). Cheers, Ralf