changeset 12417:e09c73938d46

Use sed with option -e.
author Bruno Haible <bruno@clisp.org>
date Thu, 10 Dec 2009 12:22:41 +0100
parents 804bf8e8efd3
children be5edb878c7a
files ChangeLog gnulib-tool modules/link-warning
diffstat 3 files changed, 22 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Dec 10 12:17:19 2009 +0100
+++ b/ChangeLog	Thu Dec 10 12:22:41 2009 +0100
@@ -1,3 +1,11 @@
+2009-12-09  Bruno Haible  <bruno@clisp.org>
+
+	Use sed with option -e.
+	* gnulib-tool (func_version, func_emit_copyright_notice,
+	func_emit_initmacro_end, func_import, func_create_testdir): Pass
+	option -e to sed.
+	* modules/link-warning (Makefile.am): Likewise.
+
 2009-12-10  Jim Meyering  <meyering@redhat.com>
 
 	mgetgroups: do not write bytes beyond end of malloc'd buffer
--- a/gnulib-tool	Thu Dec 10 12:17:19 2009 +0100
+++ b/gnulib-tool	Thu Dec 10 12:22:41 2009 +0100
@@ -252,7 +252,7 @@
     fi
     version=
   fi
-  year=`"$gnulib_dir"/build-aux/mdate-sh "$self_abspathname" | sed 's,^.* ,,'`
+  year=`"$gnulib_dir"/build-aux/mdate-sh "$self_abspathname" | sed -e 's,^.* ,,'`
   echo "\
 gnulib-tool (GNU $package $date)$version
 Copyright (C) $year Free Software Foundation, Inc.
@@ -267,10 +267,10 @@
 # outputs to stdout a header for a generated file.
 func_emit_copyright_notice ()
 {
-  sed -n '/Copyright/ {
-            p
-            q
-          }' < "$self_abspathname"
+  sed -n -e '/Copyright/ {
+               p
+               q
+             }' < "$self_abspathname"
   echo "#"
   echo "# This file is free software, distributed under the terms of the GNU"
   echo "# General Public License.  As a special exception to the GNU General"
@@ -1177,7 +1177,7 @@
     if test -n "$prereqs"; then
       autoconf_minversion=`
         for version in $prereqs; do echo $version; done |
-        LC_ALL=C sort -nru | sed 1q
+        LC_ALL=C sort -nru | sed -e 1q
       `
     fi
   fi
@@ -2433,7 +2433,7 @@
   echo "    if test -n \"\$${macro_prefix_arg}_LIBOBJS\"; then"
   echo "      # Remove the extension."
   echo "      sed_drop_objext='s/\\.o\$//;s/\\.obj\$//'"
-  echo "      for i in \`for i in \$${macro_prefix_arg}_LIBOBJS; do echo \"\$i\"; done | sed \"\$sed_drop_objext\" | sort | uniq\`; do"
+  echo "      for i in \`for i in \$${macro_prefix_arg}_LIBOBJS; do echo \"\$i\"; done | sed -e \"\$sed_drop_objext\" | sort | uniq\`; do"
   echo "        ${macro_prefix_arg}_libobjs=\"\$${macro_prefix_arg}_libobjs \$i.\$ac_objext\""
   echo "        ${macro_prefix_arg}_ltlibobjs=\"\$${macro_prefix_arg}_ltlibobjs \$i.lo\""
   echo "      done"
@@ -3399,7 +3399,7 @@
     esac
     echo "gl_LOCAL_DIR([$relative_local_gnulib_dir])"
     echo "gl_MODULES(["
-    echo "$specified_modules" | sed 's/^/  /g'
+    echo "$specified_modules" | sed -e 's/^/  /g'
     echo "])"
     test -z "$incobsolete" || echo "gl_WITH_OBSOLETE"
     echo "gl_AVOID([$avoidlist])"
@@ -3524,7 +3524,7 @@
                 -e "$sed_replace_build_aux"
         if test "$module" = 'alloca' && test "$libtool" = true; then
           echo 'changequote(,)dnl'
-          echo 'LTALLOCA=`echo "$ALLOCA" | sed '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`'
+          echo 'LTALLOCA=`echo "$ALLOCA" | sed -e '"'"'s/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'"'"'`'
           echo 'changequote([, ])dnl'
           echo 'AC_SUBST([LTALLOCA])'
         fi
@@ -4001,7 +4001,7 @@
     test -d "$testdir/$testsbase" || mkdir "$testdir/$testsbase"
     # Viewed from the $testsbase subdirectory, $auxdir is different.
     saved_auxdir="$auxdir"
-    auxdir=`echo "$testsbase/"|sed 's%[^/][^/]*//*%../%g'`"$auxdir"
+    auxdir=`echo "$testsbase/" | sed -e 's%[^/][^/]*//*%../%g'`"$auxdir"
     # Create $testsbase/Makefile.am.
     use_libtests=false
     destfile="$testsbase/Makefile.am"
@@ -4471,7 +4471,7 @@
       m4dirs=
       m4dirs_count=0
       if test -f "$destdir"/Makefile.am; then
-        aclocal_amflags=`sed -n 's/^ACLOCAL_AMFLAGS[	 ]*=\(.*\)$/\1/p' "$destdir"/Makefile.am`
+        aclocal_amflags=`sed -n -e 's/^ACLOCAL_AMFLAGS[	 ]*=\(.*\)$/\1/p' "$destdir"/Makefile.am`
         m4dir_is_next=
         for arg in $aclocal_amflags; do
           if test -n "$m4dir_is_next"; then
--- a/modules/link-warning	Thu Dec 10 12:17:19 2009 +0100
+++ b/modules/link-warning	Thu Dec 10 12:22:41 2009 +0100
@@ -14,8 +14,9 @@
 # build-aux/link-warning.h, except that it has the copyright header cut off.
 link-warning.h: $(top_srcdir)/build-aux/link-warning.h
 	$(AM_V_GEN)rm -f $@-t $@ && \
-	sed -n '/GL_LINK_WARNING/,$$p' \
-	  $(top_srcdir)/build-aux/link-warning.h > $@-t && \
+	sed -n -e '/GL_LINK_WARNING/,$$p' \
+	  < $(top_srcdir)/build-aux/link-warning.h \
+	  > $@-t && \
 	mv $@-t $@
 MOSTLYCLEANFILES += link-warning.h link-warning.h-t