summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2006-12-18 10:04:51 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2006-12-18 10:04:51 +0000
commit2ac1f6ab7f5c6aa0009ea4bb0b6c3109dc5bd558 (patch)
tree812f8b9ab6e9912f4ec2d4beff0a96d2f9ab874f
parentAnnounce which patchset and on which target we're handling every time. (diff)
downloadautoepatch-2ac1f6ab7f5c6aa0009ea4bb0b6c3109dc5bd558.tar.gz
autoepatch-2ac1f6ab7f5c6aa0009ea4bb0b6c3109dc5bd558.tar.bz2
autoepatch-2ac1f6ab7f5c6aa0009ea4bb0b6c3109dc5bd558.zip
Handle errors from the patching subshell in different ways depending on the code.
svn path=/trunk/; revision=9
-rwxr-xr-xautoepatch.sh10
1 files 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}"