summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac16
-rw-r--r--quilt/mail.in15
2 files changed, 14 insertions, 17 deletions
diff --git a/configure.ac b/configure.ac
index 16f9b88..77e7ddd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -50,25 +50,13 @@ QUILT_COMPAT_PROG_PATH(BASH, bash)
# though the result /could/ be available to us directly as $BASH_VERSION we
# don't want to use, or trust it, incase the user is specifying a different
# bash executable.
-if `$BASH -c '[[ "$BASH_VERSION" \< "2.04" ]]'` ; then
+if `$BASH -c '[[ "$BASH_VERSION" \< "3.2" ]]'` ; then
AC_MSG_ERROR([
-$PACKAGE_NAME requires at least version 2.04 of bash, you can download a current
+$PACKAGE_NAME requires at least version 3.2 of bash, you can download a current
version of bash from ftp.gnu.org
])
fi
-AC_MSG_CHECKING(whether $BASH quoting works)
-if test `$BASH -c "echo \"\\\$(set -- \\\$'a b'; echo \\\$#)\"" 2>/dev/null` = "1"; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([
-You have a version of `bash' which suffers from a quoting bug.
-This is a known bug of bash 3.1, which was fixed by patch bash31-011.
-You can get this patch at ftp://ftp.gnu.org/gnu/bash/
-])
-fi
-
QUILT_COMPAT_PROG_PATH(CP, cp, [gcp cp])
QUILT_COMPAT_PROG_PATH(DATE, date, [gdate date])
diff --git a/quilt/mail.in b/quilt/mail.in
index de23878..da4fcab 100644
--- a/quilt/mail.in
+++ b/quilt/mail.in
@@ -593,7 +593,11 @@ for patch in "${patches[@]}"; do
# echo "$modify" | sed -e 's/^/>> /' >&2
p=${subject_prefix//@num@/$(printf %0*d ${#total} $num)}
p=${p//@total@/$total}
- ( echo "Message-Id: <$(msgid)>"
+
+ # Make pipes fail if any of their commands fail (requires bash 3):
+ set -o pipefail
+
+ ( ( echo "Message-Id: <$(msgid)>"
awk '
/^$/ { exit }
tolower($0) !~ /^(message-id|references|in-reply-to):/ \
@@ -621,9 +625,14 @@ for patch in "${patches[@]}"; do
| sed -e $'s/^\\(Subject:[ \t]\\)/\\1'"$p"'/' \
-e '/^Subject-Prefix:/d' \
| $QUILT_DIR/scripts/edmail --remove-empty-headers \
- | process_mail
+ | process_mail ) 2> $tmpdir/err
- if [ ${PIPESTATUS[1]} -ne 0 ]
+ status=$?
+ if [ -s $tmpdir/err ]
+ then
+ sed -e "s/^/${patch//\//\\/}: /" < $tmpdir/err >&2
+ fi
+ if [ $status -ne 0 ]
then
printf $"Introduction saved as %s\n" "$introduction" >&2
exit 1