From 2ac1f6ab7f5c6aa0009ea4bb0b6c3109dc5bd558 Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Mon, 18 Dec 2006 10:04:51 +0000 Subject: Handle errors from the patching subshell in different ways depending on the code. svn path=/trunk/; revision=9 --- autoepatch.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/autoepatch.sh b/autoepatch.sh index ffa12af..1b1dd07 100755 --- a/autoepatch.sh +++ b/autoepatch.sh @@ -68,12 +68,18 @@ main() { fi if [[ -z ${PATCH_APPLIED} ]]; then - patch_required && patch_failed_msg && exit 1 + patch_required && patch_failed_msg && exit 2 fi done <<<"${targets}" exit 0 - ) || eerror "Error in subshell" + ) + + case $? in + 0) ;; # All gone well + 1) eerror "Error in subshell"; return 1 ;; # Something didn't go well + 2) return 1;; # The patch failed to apply, already announced. + esac done IFS="${save_IFS}" -- cgit v1.2.3-65-gdbad