]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in (exec_cmd): New variable. Don't exec programs within
authorAlexandre Oliva <aoliva@redhat.com>
Sun, 20 May 2001 18:09:56 +0000 (18:09 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sun, 20 May 2001 18:09:56 +0000 (18:09 +0000)
the big `case'; set the variable instead, and exec the cmd
afterwards, so that the shell gets a chance to clean up here-doc
files.
* NEWS: Update.

ChangeLog
NEWS
ltmain.in

index 25869b73e914849dd2f3edfa40be63c8bb18589f..1741a1f651f0d5aa483ef87975a6fc9aeabbfc6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-05-20  Alexandre Oliva  <aoliva@redhat.com>
+
+       * ltmain.in (exec_cmd): New variable.  Don't exec programs within
+       the big `case'; set the variable instead, and exec the cmd
+       afterwards, so that the shell gets a chance to clean up here-doc
+       files.
+       * NEWS: Update.
+
 2001-05-16  Alan Modra  <amodra@one.net.au>
 
        * libtool.m4 (lt_cv_deplibs_check_method): pass_all for hppa*-linux.
diff --git a/NEWS b/NEWS
index 8df67c7e795fb6176dc91042c441b827e57f83b4..a50c9a22e9ce11b4f3b6de50f9b7c67f90324e1b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,13 @@ New in 1.4b: 2001-??-??; CVS version 1.4a, Libtool team:
 * Full support for C++ compiler.
 * Support for GNU gcj compiler.
 \f
+New in 1.4.1: 2001-??-??; CVS version 1.4.0a, Libtool team:
+* Don't leave here-doc files behind.
+\f
+New in 1.4: 2001-04-25; CVS version 1.3e, Libtool team:
+* Support for aix5*.
+* Bugfixes.
+\f
 New in 1.3d: 2001-04-02; CVS version 1.3c, Libtool team:
 * ltconfig is no more.  Generation of libtool happens directly from
   the configure file.
index 7c26afe9a8fd513f8ee2e444e8c51b0cec1eae11..1afec11baa40e5ab306c53dff20a3876874be5c6 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -246,6 +246,11 @@ if test -n "$prevopt"; then
   exit 1
 fi
 
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
 if test -z "$show_help"; then
 
   # Infer the operation mode.
@@ -4841,11 +4846,10 @@ relink_command=\"$relink_command\""
     if test -n "$current_libdirs"; then
       # Maybe just do a dry run.
       test -n "$run" && current_libdirs=" -n$current_libdirs"
-      exec $SHELL $0 --finish$current_libdirs
-      exit 1
+      exec_cmd='$SHELL $0 --finish$current_libdirs'
+    else
+      exit 0
     fi
-
-    exit 0
     ;;
 
   # libtool finish mode
@@ -5048,11 +5052,8 @@ relink_command=\"$relink_command\""
        LANG="$save_LANG"; export LANG
       fi
 
-      # Now actually exec the command.
-      eval "exec \$cmd$args"
-
-      $echo "$modename: cannot exec \$cmd$args"
-      exit 1
+      # Now prepare to actually exec the command.
+      exec_cmd='"$cmd"$args'
     else
       # Display what would be done.
       if test -n "$shlibpath_var"; then
@@ -5231,11 +5232,18 @@ relink_command=\"$relink_command\""
     ;;
   esac
 
-  $echo "$modename: invalid operation mode \`$mode'" 1>&2
-  $echo "$generic_help" 1>&2
-  exit 1
+  if test -z "$exec_cmd"; then
+    $echo "$modename: invalid operation mode \`$mode'" 1>&2
+    $echo "$generic_help" 1>&2
+    exit 1
+  fi
 fi # test -z "$show_help"
 
+if test -n "$exec_cmd"; then
+  eval exec $exec_cmd
+  exit 1
+fi
+
 # We need to display help for each of the modes.
 case $mode in
 "") $echo \