Mercurial > hg > octave-nkf > gnulib-hg
changeset 7322:46d98b687a87
Speed up presentation of the include files.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Mon, 18 Sep 2006 13:04:17 +0000 |
parents | 3bf1b669d1e1 |
children | 7ca0e325d5db |
files | ChangeLog gnulib-tool |
diffstat | 2 files changed, 31 insertions(+), 24 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-09-15 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> + + Speed up by a factor of 1.12. + * gnulib-tool (nl): New variable. + (func_import): Rewrite include directive extraction to only read each + directive once. + 2006-09-17 Bruno Haible <bruno@clisp.org> * gnulib-tool (func_create_testdir): Rewrite all files at once.
--- a/gnulib-tool +++ b/gnulib-tool @@ -22,9 +22,11 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2006-09-18 13:03:14 $' +cvsdatestamp='$Date: 2006-09-18 13:04:17 $' last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` +nl=' +' # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH. AUTOCONFPATH= @@ -1943,30 +1945,28 @@ echo "Finished." echo echo "You may need to add #include directives for the following .h files." + # First the #include <...> directives without #ifs, sorted for convenience, + # then the #include "..." directives without #ifs, sorted for convenience, + # then the #include directives that are surrounded by #ifs. Not sorted. + for module in $modules; do + include_directive=`func_get_include_directive "$module"` + case "$nl$include_directive" in + *"$nl#if"*) + echo "$include_directive" 1>&5 + ;; + *) + echo "$include_directive" | grep -v 'include "' 1>&6 + echo "$include_directive" | grep 'include "' 1>&7 + ;; + esac + done 5> "$tmp"/include-if 6> "$tmp"/include-angles 7> "$tmp"/include-quotes ( - # First the #include <...> directives without #ifs, sorted for convenience. - for module in $modules; do - if func_get_include_directive "$module" | grep '^#if' >/dev/null; then - : - else - func_get_include_directive "$module" | grep -v 'include "' - fi - done | LC_ALL=C sort -u - # Then the #include "..." directives without #ifs, sorted for convenience. - for module in $modules; do - if func_get_include_directive "$module" | grep '^#if' >/dev/null; then - : - else - func_get_include_directive "$module" | grep 'include "' - fi - done | LC_ALL=C sort -u - # Then the #include directives that are surrounded by #ifs. Not sorted. - for module in $modules; do - if func_get_include_directive "$module" | grep '^#if' >/dev/null; then - func_get_include_directive "$module" - fi - done - ) | sed -e '/^$/d;' -e 's/^/ /' + LC_ALL=C sort -u "$tmp"/include-angles + LC_ALL=C sort -u "$tmp"/include-quotes + cat "$tmp"/include-if + ) | sed -e '/^$/d' -e 's/^/ /' + rm -f "$tmp"/include-angles "$tmp"/include-quotes "$tmp"/include-if + echo echo "Don't forget to" if test "$makefile_am" = Makefile.am; then