]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Replace uses of $SED $basename.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 23 Nov 2008 13:52:32 +0000 (14:52 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 23 Nov 2008 13:52:32 +0000 (14:52 +0100)
* libltdl/config/ltmain.m4sh (func_mode_link): Replace instances
of `$ECHO ... | $SED' with calls to func_basename.
* libtoolize.m4sh (func_copy, func_serial)
(func_massage_aclocal_DATA): Likewise, replace with
func_dirname_and_basename.
* tests/defs.m4sh (func_configure_nofail, func_make, func_exec):
Likewise.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
libltdl/config/ltmain.m4sh
libtoolize.m4sh
tests/defs.m4sh

index 03e6d3f24d9a1c165b1cacc045e0d614fe1da63f..44efdcb90f777c3e02b84cebadbfdb7363474f21 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2008-11-23  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Replace uses of $SED $basename.
+       * libltdl/config/ltmain.m4sh (func_mode_link): Replace instances
+       of `$ECHO ... | $SED' with calls to func_basename.
+       * libtoolize.m4sh (func_copy, func_serial)
+       (func_massage_aclocal_DATA): Likewise, replace with
+       func_dirname_and_basename.
+       * tests/defs.m4sh (func_configure_nofail, func_make, func_exec):
+       Likewise.
+
        No need to prepend $progname with './'.
        * libltdl/config/general.m4sh (func_dirname_and_basename): $ECHO
        copes with leading hyphens now, so do not mangle $progname any
index 937f14e1a55e408963d5d3d867ae8a72d0b4a520..28ad40de510a348199a8ebb0112552eabd9c05e1 100644 (file)
@@ -4764,7 +4764,8 @@ func_mode_link ()
          # Collect preopened libtool deplibs, except any this library
          # has declared as weak libs
          for deplib in $dependency_libs; do
-            deplib_base=`$ECHO "$deplib" | $SED "$basename"`
+           func_basename "$deplib"
+            deplib_base=$func_basename_result
            case " $weak_libs " in
            *" $deplib_base "*) ;;
            *) deplibs="$deplibs $deplib" ;;
@@ -6846,7 +6847,8 @@ EOF
            save_libobjs=$libobjs
          fi
          save_output=$output
-         output_la=`$ECHO "$output" | $SED "$basename"`
+         func_basename "$output"
+         output_la=$func_basename_result
 
          # Clear the reloadable object creation command queue and
          # initialize k to one.
index 1427e61feacf036b6c0ac27e986bdb79c658de58..941ad8553f8d09a8a7dd367cefd6940689e9f430 100644 (file)
@@ -269,7 +269,8 @@ func_copy ()
     test -f "$1" || \
       { func_error "\`$1' not copied:  not a regular file"; return 1; }
 
-    my_f1=`$ECHO "$1" | $SED "$basename"`
+    func_dirname_and_basename "$1"
+    my_f1=$func_basename_result
 
     if test -d "$2"; then
 
@@ -279,7 +280,9 @@ func_copy ()
     else
 
       # Supporting this would mean changing the timestamp:
-      test "X$my_f1" = X`$ECHO "$2" | $SED "$basename"` \
+      func_dirname_and_basename "$2"
+      my_tname=$func_basename_result
+      test "X$my_f1" = "X$my_tname" \
         || func_fatal_error "func_copy() cannot change filename on copy"
 
       func_copy_cb "$my_f1" \
@@ -705,10 +708,12 @@ func_serial ()
     # Search FILENAME and all the files it m4_includes for a serial number
     # in the file that AC_DEFUNs MACRO_REGEX.
     my_serial=
+    func_dirname_and_basename "$my_filename"
+    my_filebase=$func_basename_result
     for my_file in `func_included_files "$my_filename"`; do
       if test -z "$my_macro_regex" ||
          test "$my_filename" = aclocal.m4 ||
-         test "$my_macro_regex" = `echo "$my_filename" | $SED "$basename"` ||
+         test "X$my_macro_regex" = "X$my_filebase" ||
          func_grep '^AC_DEFUN(\@<:@'"$my_macro_regex" "$my_file"
       then
         my_serial=`$SED -e "$my_sed_serial" "$my_file"`
@@ -1040,7 +1045,8 @@ func_massage_aclocal_DATA ()
 
     # Massage a value for pkgmacro_files from the value used in Makefile.am.
     for my_filename in @aclocal_DATA@; do
-      my_filename=`$ECHO "$my_filename" | $SED "$basename"`
+      func_dirname_and_basename "$my_filename"
+      my_filename=$func_basename_result
 
       # ignore excluded filenames
       if test -n "$my_glob_exclude"; then
index dc238262ae93ec643cac88dbf8fa52b9b696c036..27c6f77f2b02986086478e03b0a451fd8c3ffee8 100644 (file)
@@ -187,7 +187,8 @@ func_configure_nofail ()
 {
     $opt_debug
     my_args=${1+"$@"}
-    my_dir=`pwd | $SED "$basename"`
+    func_dirname_and_basename "`pwd`"
+    my_dir=$func_basename_result
     my_testdir="$srcdir/tests/$my_dir"
     conf_status=$EXIT_FAILURE
 
@@ -245,7 +246,8 @@ func_make ()
 {
     $opt_debug
     my_args=${1+"$@"}
-    my_dir=`pwd | $SED "$basename"`
+    func_dirname_and_basename "`pwd`"
+    my_dir=$func_basename_result
 
     func_msg "Running \`$MAKE $my_args' in $my_dir"
 
@@ -317,7 +319,8 @@ func_exec ()
     $opt_debug
     my_program="$1"
     my_exp_output="$2"
-    my_dir=`pwd | $SED "$basename"`
+    func_dirname_and_basename "`pwd`"
+    my_dir=$func_basename_result
 
     test -n "$my_exp_output" \
       && my_exp_output="| $EGREP -e "\""$my_exp_output"\"