]> 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:10:01 +0000 (18:10 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sun, 20 May 2001 18:10:01 +0000 (18:10 +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 ae97322015311d44dd60f390d2de0d32c17b37df..a8f5221d0e6aef3f6c0ca6c248fc4a7bbf461162 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 e0b7ebf37b8609abdc3faaec33a62afb127f9234..a7c575c48fb454fc302ee0daeacdd9da5ddc006a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 NEWS - list of user-visible changes between releases of GNU Libtool
 
+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.
index 4a9e5347f80daf04218c92917a617a3af69e3b90..e386f659aab9b1f5314f8cf5094ff0459e62a98c 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -202,6 +202,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.
@@ -4369,11 +4374,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
@@ -4576,11 +4580,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
@@ -4745,11 +4746,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 \