]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Update to the latest mailnotify script from
authorGary V. Vaughan <gary@gnu.org>
Fri, 15 Oct 2004 17:29:47 +0000 (17:29 +0000)
committerGary V. Vaughan <gary@gnu.org>
Fri, 15 Oct 2004 17:29:47 +0000 (17:29 +0000)
gary@gnu.org--2004/cvs-utils--tla--1.0:

* config/mailnotify.m4sh: Fix bugs in sendmail search and
for loop invocations.

ChangeLog
config/mailnotify.m4sh

index 1fe5a3d1e3fb065791d9e2cf58f020a2d471c364..2428ae34862e8fbc4de153be52657cb2c3ee4d30 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-10-15  Gary V. Vaughan  <gary@gnu.org>
+
+       Update to the latest mailnotify script from
+       gary@gnu.org--2004/cvs-utils--tla--1.0:
+
+       * config/mailnotify.m4sh: Fix bugs in sendmail search and
+       for loop invocations.
+
 2004-10-14  Peter O'Gorman  <peter@pogma.com>
 
        * config/ltmain.m4sh: Revert most of my last commit, only eval
index 894a5b47cfddb6febb6092fd2505913a0e04126c..7160893b6865871c99fc36140b19e38358c97a2f 100644 (file)
@@ -60,6 +60,7 @@ m4_divert_push([SCRIPT])#!/bin/sh
 
 : ${TMPDIR=/tmp}
 : ${HOST=`hostname`}
+: ${SENDMAIL=sendmail}
 
 PROGRAM=mailnotify
 
@@ -285,13 +286,17 @@ func_sendmail ()
     from_name=`echo "$my_from" | sed 's, *<.*> *$,,;s,",,g'`
     from_addr=`echo "$my_from" | sed "$sed_mail_address"`
 
-    SENDMAIL=sendmail
-    for try_sendmail in sendmail /usr/lib/sendmail /usr/sbin/sendmail; do
-       if which $try_sendmail >/dev/null 2>&1; then
-           SENDMAIL=$try_sendmail
+    save_IFS="$IFS"
+    IFS=':'
+    for try_sendmail_dir in /usr/lib:/usr/sbin:$PATH; do
+        IFS="$save_IFS"
+       if test -x "$try_sendmail_dir/$SENDMAIL"; then
+           SENDMAIL="$try_sendmail_dir/$SENDMAIL"
            break
        fi
     done
+    IFS="$save_IFS"
+    test -x "$SENDMAIL" || func_fatal_error "sendmail executable not found"
 
     func_verbose "Delivering mail, please wait..."
     if test -n "$from_name"; then
@@ -320,8 +325,10 @@ func_sendmail ()
   trap 'rm -f "$fname"; exit 1' 1 2 15
 
   destination=""
-  for to;
+  for to in : ${1+"$@"}
   do
+      test "X$to" = X: && continue
+
       case $destination in
          "") destination="$to" ;;
           *)  destination="$destination, $to" ;;
@@ -337,7 +344,10 @@ func_sendmail ()
 
   if test -z "$outputfile"; then
       destination=""
-      for to; do
+      for to in : ${1+"$@"}
+      do
+          test "X$to" = X: && continue
+
           to_addr=`echo "$to" | sed "$sed_mail_address"`
          test -n "$to_addr" || to_addr="$to"
          destination="$destination $to_addr"