libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: fix sed syntax


From: Ralf Wildenhues
Subject: Re: FYI: fix sed syntax
Date: Sat, 21 Jan 2006 17:47:38 +0100
User-agent: Mutt/1.5.9i

* Ralf Wildenhues wrote on Sat, Jan 21, 2006 at 05:45:43PM CET:
> http://article.gmane.org/gmane.comp.sysutils.autoconf.patches/2649

Ditto for branch-1-5.

Cheers,
Ralf

        * libtool.m4 (_LT_AC_SYS_LIBPATH_AIX): Don't use semicolons
        inside { } in sed scripts, as Posix says it's not portable.
        * ltmain.in (func_win32_libid): Likewise.
        * mailnotify, commit: Likewise.
        Noted by Paul Eggert <address@hidden>.

Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.147
diff -u -r1.314.2.147 libtool.m4
--- libtool.m4  12 Jan 2006 22:04:28 -0000      1.314.2.147
+++ libtool.m4  21 Jan 2006 16:40:11 -0000
@@ -288,11 +288,18 @@
 # to the aix ld manual.
 AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
 [AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File 
Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+       /^0/ {
+           s/^0  *\(.*\)$/\1/
+           p
+       }
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e 
"$lt_aix_libpath_sed"`
 # Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 
2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  
*\(.*\)$/\1/; p; }
-}'`; fi],[])
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e 
"$lt_aix_libpath_sed"`
+fi],[])
 if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
 ])# _LT_AC_SYS_LIBPATH_AIX
 
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.117
diff -u -r1.334.2.117 ltmain.in
--- ltmain.in   21 Jan 2006 08:58:04 -0000      1.334.2.117
+++ ltmain.in   21 Jan 2006 16:40:13 -0000
@@ -196,7 +196,13 @@
     if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
       $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
       win32_nmres=`eval $NM -f posix -A $1 | \
-       $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'`
+       $SED -n -e '1,100{
+               / I /{
+                       s,.*,import,
+                       p
+                       q
+                       }
+               }'`
       case $win32_nmres in
       import*)  win32_libid_type="x86 archive import";;
       *)        win32_libid_type="x86 archive static";;
Index: commit
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/commit,v
retrieving revision 1.14.4.8
diff -u -r1.14.4.8 commit
--- commit      22 Apr 2005 09:05:40 -0000      1.14.4.8
+++ commit      21 Jan 2006 16:40:09 -0000
@@ -166,9 +166,10 @@
 func_usage ()
 {
     $SED '/^# Usage:/,/# -h/ {
-        s/^# //; s/^# *$//;
-       s/\$progname/'$progname'/;
-       p;
+        s/^# //
+       s/^# *$//
+       s/\$progname/'$progname'/
+       p
     }; d' < "$progpath"
     echo
     echo "run \`$progname --help | more' for full usage"
@@ -180,9 +181,10 @@
 func_help ()
 {
     $SED '/^# Usage:/,/# Report bugs to/ {
-        s/^# //; s/^# *$//;
-       s/\$progname/'$progname'/;
-       p;
+        s/^# //
+       s/^# *$//
+       s/\$progname/'$progname'/
+       p
      }; d' < "$progpath"
     exit $EXIT_SUCCESS
 }
@@ -192,9 +194,10 @@
 func_version ()
 {
     $SED '/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //; s/^# *$//;
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/;
-        p;
+        s/^# //
+       s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
      }; d' < "$progpath"
      exit $EXIT_SUCCESS
 }
Index: mailnotify
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/mailnotify,v
retrieving revision 1.1.2.5
diff -u -r1.1.2.5 mailnotify
--- mailnotify  22 Apr 2005 09:05:41 -0000      1.1.2.5
+++ mailnotify  21 Jan 2006 16:40:13 -0000
@@ -137,9 +137,10 @@
 func_usage ()
 {
     $SED '/^# Usage:/,/# -h/ {
-        s/^# //; s/^# *$//;
-       s/\$progname/'$progname'/;
-       p;
+        s/^# //
+       s/^# *$//
+       s/\$progname/'$progname'/
+       p
     }; d' < "$progpath"
     echo
     echo "run \`$progname --help | more' for full usage"
@@ -151,9 +152,10 @@
 func_help ()
 {
     $SED '/^# Usage:/,/# Report bugs to/ {
-        s/^# //; s/^# *$//;
-       s/\$progname/'$progname'/;
-       p;
+        s/^# //
+       s/^# *$//
+       s/\$progname/'$progname'/
+       p
      }; d' < "$progpath"
     exit $EXIT_SUCCESS
 }
@@ -163,9 +165,10 @@
 func_version ()
 {
     $SED '/^# '$PROGRAM' (GNU /,/# warranty; / {
-        s/^# //; s/^# *$//;
-        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/;
-        p;
+        s/^# //
+       s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
      }; d' < "$progpath"
      exit $EXIT_SUCCESS
 }
@@ -292,7 +295,10 @@
 {
     my_outfile="$1"
     my_destination="$2"
-    my_sed_version_no='/^# '$PROGRAM' (GNU / { s/^# .*version //; p; }; d'
+    my_sed_version_no='/^# '$PROGRAM' (GNU / {
+                          s/^# .*version //
+                          p
+                      }; d'
 
     {
        echo "User-Agent: $PROGRAM/`$SED \"$my_sed_version_no\" < $progpath`"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]