From b68256173ba650db55e103b98412e9024d8f81d8 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sat, 23 Jun 2007 07:40:57 +0000 Subject: [PATCH] * gnulib-tool (IFS): Initialize early, so we don't set it to empty later. (self_abspathname): Rewrite algorithm to set it, reindent. (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am) (func_create_megatestdir): Merge some sed scripts. --- ChangeLog | 8 ++++++++ gnulib-tool | 59 ++++++++++++++++++++++++++++++----------------------- 2 files changed, 42 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7853b70248..34ebacd1e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-06-23 Ralf Wildenhues + + * gnulib-tool (IFS): Initialize early, so we don't set it to + empty later. + (self_abspathname): Rewrite algorithm to set it, reindent. + (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am) + (func_create_megatestdir): Merge some sed scripts. + 2007-06-23 Paul Eggert * m4/include_next.m4 (gl_CHECK_NEXT_HEADERS): Check some typos diff --git a/gnulib-tool b/gnulib-tool index 559aa7ca98..ef8e9ac89c 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -22,11 +22,12 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2007-06-23 02:02:46 $' +cvsdatestamp='$Date: 2007-06-23 07:40:58 $' last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` nl=' ' +IFS=" "" $nl" # You can set AUTOCONFPATH to empty if autoconf 2.57 is already in your PATH. AUTOCONFPATH= @@ -836,16 +837,24 @@ fi case "$0" in /*) self_abspathname="$0" ;; */*) self_abspathname=`pwd`/"$0" ;; - *) for d in `echo ":$PATH:" | sed -e 's/:::*/:.:/g' | sed -e 's/:/ /g'`; do - if test -x "$d/$0" && test ! -d "$d/$0"; then - self_abspathname="$d/$0" - break - fi - done - if test -z "$self_abspathname"; then - func_fatal_error "could not locate the gnulib-tool program - how did you invoke it?" - fi - ;; + *) + + 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 + 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. @@ -1353,12 +1362,12 @@ func_emit_lib_Makefile_am () { func_get_automake_snippet "$module" | sed -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \ - -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' | - sed -e "$sed_eliminate_LDFLAGS" | - sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' | - sed -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \ - -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' | - sed -e "$sed_transform_check_PROGRAMS" + -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \ + -e "$sed_eliminate_LDFLAGS" \ + -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \ + -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \ + -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \ + -e "$sed_transform_check_PROGRAMS" if test "$module" = 'alloca'; then echo "${libname}_${libext}_LIBADD += @${perhapsLT}ALLOCA@" echo "${libname}_${libext}_DEPENDENCIES += @${perhapsLT}ALLOCA@" @@ -1498,12 +1507,12 @@ func_emit_tests_Makefile_am () { func_get_automake_snippet "$module" | sed -e 's,lib_LIBRARIES,lib%_LIBRARIES,g' \ - -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' | - sed -e "$sed_eliminate_LDFLAGS" | - sed -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' | - sed -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \ - -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' | - sed -e "$sed_transform_check_PROGRAMS" + -e 's,lib_LTLIBRARIES,lib%_LTLIBRARIES,g' \ + -e "$sed_eliminate_LDFLAGS" \ + -e 's,lib_\([A-Z][A-Z]*\),'"${libname}_${libext}"'_\1,g' \ + -e 's,lib%_LIBRARIES,lib_LIBRARIES,g' \ + -e 's,lib%_LTLIBRARIES,lib_LTLIBRARIES,g' \ + -e "$sed_transform_check_PROGRAMS" } > amsnippet.tmp # Skip the contents if its entirely empty. if grep '[^ ]' amsnippet.tmp > /dev/null ; then @@ -2998,8 +3007,8 @@ func_create_megatestdir () -e 's,October,10,' -e 's,Oct,10,' \ -e 's,November,11,' -e 's,Nov,11,' \ -e 's,December,12,' -e 's,Dec,12,' \ - | sed -e 's,^,00,' | sed -e 's,^[0-9]*\([0-9][0-9] \),\1,' \ - | sed -e 's,^\([0-9]*\) \([0-9]*\) \([0-9]*\),\3\2\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" echo "test -d logs || mkdir logs" -- 2.30.2