@@ -170,7 +170,7 @@ apply_patch() {
git checkout . || exit 1
git clean -xdf || exit 1
popd > /dev/null
- continue
+ return 1
else
#3way apply worked
echo " Warning: git am --3way, applied"
@@ -182,7 +182,7 @@ apply_patch() {
git checkout . || exit 1
git clean -xdf || exit 1
popd > /dev/null
- continue
+ return 1
fi
else
#patch successfully applied:
@@ -194,6 +194,7 @@ apply_patch() {
fi
popd > /dev/null
+ return 0
}
format_patch() {
@@ -261,6 +262,10 @@ for patch in $(find $PATCH_DIR -type f -iregex "${FILE_EXT_REGEX}" |sort -h); do
CURRENT_LOG="${ODP_LOGDIR}/$(echo $(basename ${patch}))"
echo -e "\n\nUsing patch: $(basename ${patch})"
apply_patch ${ODP_BUILDDIR} ${CURRENT_LOG}
+ #if applying the patch failed, take next one:
+ if [ $? -ne 0 ]; then
+ continue
+ fi
format_patch ${ODP_BUILDDIR} ${CURRENT_LOG}
function apply_patch() now returns a status rather than directely breaking the loop of its caller. (for loop in main, continue statment in apply_patch()) Signed-off-by: Christophe Milard <christophe.milard@linaro.org> --- apply-and-build.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)