]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtoolize: fix some long-standing sed substitution bugs
authorGary V. Vaughan <gary@gnu.org>
Mon, 31 Oct 2011 11:29:35 +0000 (18:29 +0700)
committerGary V. Vaughan <gary@gnu.org>
Mon, 31 Oct 2011 12:49:49 +0000 (19:49 +0700)
* libtoolize.m4sh (func_fixup_Makefile): `\\\\\$' in a " quoted
script that is evaluated twice before execution becomes a `\$',
which sed interprets as a literal $.  The script will then delete
any lines with a first non-whitespace character of `$'. Instead
use `\\\\$' in single quotes, which sed eventually receives as
`\\$' and correctly interprets as part of an instruction to
delete otherwise empty lines ending with a `\'.
Additionally the rest of the same sed script is no longer
applied to comment lines to avoid munging the copyright header
among others.
* NEWS: Updated.

NEWS
libtoolize.m4sh

diff --git a/NEWS b/NEWS
index a960e433398b5fa4d2a4695548b63352c8cd01c6..94de233f89efc706e55067c496df1046d404f643 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,9 @@ NEWS - list of user-visible changes between releases of GNU Libtool
 
   - Fix a long-standing latent bug in autom4te include path for autotests
     with VPATH builds.
+  - Fix a long-standing latent bug in libtoolize which could delete lines
+    from libltdl/Makefile.am in recursive mode due to underquoting in a
+    sed script.
 
 New in 2.4.2 2011-10-17: git version 2.4.1a, Libtool team:
 
index 1626c177ed3d7de1e3fac9c1253c4fdd7683128d..4489b57dd1df276e1a3e43871e745425afeef1b9 100644 (file)
@@ -320,7 +320,7 @@ func_fixup_Makefile ()
     my_filename="$1"
     my_srcdir="$2"
     my_destdir="$3"
-    my_fixup_non_subpackage_script="\
+    my_fixup_non_subpackage_script='/^[^#]/{
       s,(LIBOBJS),(ltdl_LIBOBJS),g
       s,(LTLIBOBJS),(ltdl_LTLIBOBJS),g
       s,libltdl/configure.ac,,
@@ -329,7 +329,8 @@ func_fixup_Makefile ()
       s,libltdl/config-h.in,,
       s,libltdl/Makefile.am,,
       s,libltdl/Makefile.in,,
-      /^[       ]*\\\\\$/d"
+      /^[       ]*\\\\$/d
+    }'
     case $my_filename in
       Makefile.am)
        my_fixup_non_subpackage_script=`echo "$my_fixup_non_subpackage_script" | \