aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Roxell <anders.roxell@linaro.org>2014-11-28 08:56:33 +0100
committerAnders Roxell <anders.roxell@linaro.org>2014-11-28 08:56:33 +0100
commitf1b671a26fd9a8fb88de6f674edf713a2d0c8155 (patch)
treedcaaa3151d94b06a303403ca1d9baef5d3b0c304
parentf3de147dfa43cf460efac2827f2efa8b0cb5534e (diff)
apply-and-build: try with 3way flag if normal am fails
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
-rwxr-xr-xapply-and-build.sh30
1 files changed, 25 insertions, 5 deletions
diff --git a/apply-and-build.sh b/apply-and-build.sh
index edf6d4b..c683276 100755
--- a/apply-and-build.sh
+++ b/apply-and-build.sh
@@ -122,14 +122,34 @@ for patch in $PATCH_DIR/* ; do
pushd ${TMP_GIT_DIR}
echo git am ${patch} | tee -a ${CURRENT_LOG}-patch.log
- git am ${patch}
- if [ $? -ne 0 ]; then
+ git am ${patch} 2>&1 >> ${CURRENT_LOG}-am.log
+ egrep "^Patch failed at" ${CURRENT_LOG}-am.log
+ if [ $? -eq 0 ]; then
+ cat ${CURRENT_LOG}-am.log >> ${CURRENT_LOG}-patch.log
+ rm ${CURRENT_LOG}-am.log
+ echo "" | tee -a ${CURRENT_LOG}-patch.log
echo " Patch failed" | tee -a ${CURRENT_LOG}-patch.log
- git am --abort | tee -a ${CURRENT_LOG}-patch.log
+ echo "" | tee -a ${CURRENT_LOG}-patch.log
+ git am --abort
git checkout .
git clean -xdf
- popd
- continue
+ echo git am --3way ${patch} | tee -a ${CURRENT_LOG}-patch.log
+ git am --3way ${patch} 2>&1 >> ${CURRENT_LOG}-am-3way.log
+ egrep "^Patch failed at" ${CURRENT_LOG}-am-3way.log
+ if [ $? -eq 0 ]; then
+ cat ${CURRENT_LOG}-am.log >> ${CURRENT_LOG}-patch.log
+ rm ${CURRENT_LOG}-am.log
+ echo "" | tee -a ${CURRENT_LOG}-patch.log
+ echo " Patch --3way failed" | tee -a ${CURRENT_LOG}-patch.log
+ echo "" | tee -a ${CURRENT_LOG}-patch.log
+ git am --abort
+ git checkout .
+ git clean -xdf
+ popd
+ # Checking log files
+ cat ${CURRENT_LOG}-patch.log >> ${SUMMARY_LOG}
+ continue
+ fi
fi