libtool-patches
[Top][All Lists]
Advanced

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

[PATCH 1/4] libtoolize: use only space delimited file lists.


From: Gary V. Vaughan
Subject: [PATCH 1/4] libtoolize: use only space delimited file lists.
Date: Sun, 6 Nov 2011 00:04:42 +0700

This next series of patches simplifies both Makefile.am and libtoolize.m4sh
enough that manipulations of the file lists by libtoolize at install time
become managable enough to do a nice rewrite of the config->build-aux rename
patch that I'll get to next.

By itself, this one is obvious enough.  The rest of the series each tackles
one directory full of files and the various variables and functions used by
libtoolize to copy files around, and for Makefile.am to install.

As with the other series I posted today, I'll push all of these in 72 hours
or more - subject to any review comments or other issues that need to be
addressed first.

We don't install any files with whitespace in their file name,
so using colon delimited lists to make that possible was a
premature optimisation and an unneeded complication.
* libtoolize.m4sh (func_copy_some_files): Remove IFS twiddling,
and just pull space delimited files in a for loop idiomatically.
(func_massage_aclocal_DATA, func_install_pkgmacro_subproject)
(func_install_pkgmacro_parent, func_install_pkgmacro_files)
(func_massage_pkgltdl_files, func_massage_pkgconfig_files):
Append to file lists with space delimiter.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 libtoolize.m4sh |   44 +++++++++++++-------------------------------
 1 files changed, 13 insertions(+), 31 deletions(-)

diff --git a/libtoolize.m4sh b/libtoolize.m4sh
index a971276..7568f1c 100644
--- a/libtoolize.m4sh
+++ b/libtoolize.m4sh
@@ -270,24 +270,20 @@ func_copy_cb ()
 }
 
 
-# func_copy_some_files srcfile_spec srcdir destdir [msg_var] [cb=func_copy_cb]
-# Call COPY_CB for each regular file in SRCDIR named by the ':' delimited
-# names in SRCFILE_SPEC.  The odd calling convention is needed to allow
-# spaces in file and directory names.
+# func_copy_some_files srcfile_list srcdir destdir [msg_var] [cb=func_copy_cb]
+# Call COPY_CB for each regular file in SRCDIR named by the space delimited
+# names in SRCFILE_LIST.
 func_copy_some_files ()
 {
     $debug_cmd
 
-    my_srcfile_spec="$1"
+    my_srcfile_list="$1"
     my_srcdir="$2"
     my_destdir="$3"
     my_msg_var="$4"
     my_copy_cb="${5-func_copy_cb}"
 
-    my_save_IFS="$IFS"
-    IFS=:
-    for my_filename in $my_srcfile_spec; do
-      IFS="$my_save_IFS"
+    for my_filename in $my_srcfile_list; do
       if test -f "$my_srcdir/$my_filename"; then
         if test "X$my_copy_cb" = Xfunc_copy_cb; then
          $opt_force || if test -f "$my_destdir/$my_filename"; then
@@ -304,7 +300,6 @@ func_copy_some_files ()
 
       $my_copy_cb "$my_filename" "$my_srcdir" "$my_destdir" "$my_msg_var"
     done
-    IFS="$my_save_IFS"
 }
 
 
@@ -787,11 +782,8 @@ func_massage_aclocal_DATA ()
        $my_cont && continue
       fi
 
-      pkgmacro_files="$pkgmacro_files:$my_filename"
+      pkgmacro_files="${pkgmacro_files+$pkgmacro_files }$my_filename"
     done
-
-    # strip spurious leading `:'
-    pkgmacro_files=`$ECHO "$pkgmacro_files" | $SED 's,^:*,,'`
 }
 
 
@@ -819,7 +811,7 @@ func_install_pkgmacro_subproject ()
       pkgmacro_header="putting macros in AC_CONFIG_MACRO_DIR, 
\`$subproject_macro_dir'."
     fi
 
-    func_copy_some_files "argz.m4:libtool.m4:ltdl.m4:$pkgmacro_files" \
+    func_copy_some_files "libtool.m4 ltdl.m4 $pkgmacro_files" \
       "$aclocaldir" "$subproject_macro_dir" pkgmacro_header
 }
 
@@ -867,14 +859,10 @@ func_install_pkgmacro_parent ()
       func_verbose "Not copying \`$macro_dir/ltdl.m4', libltdl not used."
     fi
 
-    my_save_IFS="$IFS"
-    IFS=:
     for file in $pkgmacro_files; do
-      IFS="$my_save_IFS"
       func_serial_update "$file" "$aclocaldir" "$macro_dir" \
         my_pkgmacro_header "$file"
     done
-    IFS="$my_save_IFS"
 }
 
 
@@ -941,14 +929,11 @@ func_massage_pkgltdl_files ()
       fi
 
       # ignore duplicates
-      case :$pkgltdl_files: in
-        *:$my_filename:*) ;;
-       *) pkgltdl_files="$pkgltdl_files:$my_filename" ;;
+      case " "$pkgltdl_files" " in
+        *" $my_filename "*) ;;
+       *) pkgltdl_files="${pkgltdl_files+$pkgltdl_files }$my_filename" ;;
       esac
     done
-
-    # strip spurious leading `:'
-    pkgltdl_files=`$ECHO "$pkgltdl_files" | $SED 's,^:*,,'`
 }
 
 
@@ -1025,14 +1010,11 @@ func_massage_pkgconfig_files ()
       fi
 
       # ignore duplicates
-      case :$pkgconfig_files: in
-        *:$my_filename:*) ;;
-       *) pkgconfig_files="$pkgconfig_files:$my_filename" ;;
+      case " "$pkgconfig_files" " in
+        *" $my_filename "*) ;;
+       *) pkgconfig_files="${pkgconfig_files+$pkgconfig_files }$my_filename" ;;
       esac
     done
-
-    # strip spurious leading `:'
-    pkgconfig_files=`$ECHO "$pkgconfig_files" | $SED 's,^:*,,'`
 }
 
 
-- 
1.7.7.2

Cheers,
-- 
Gary V. Vaughan (gary AT gnu DOT org)


reply via email to

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