When an empty patch (such as a cover letter) was given to
apply-and-build, the latter would fail applying the patch and all
following patches (saying OK when it could be wrong)

Signed-off-by: Christophe Milard <[email protected]>
---
 apply-and-build.sh | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/apply-and-build.sh b/apply-and-build.sh
index 7195f40..d4cc0d9 100755
--- a/apply-and-build.sh
+++ b/apply-and-build.sh
@@ -147,18 +147,16 @@ apply_patch() {
 
     echo "  Trying to apply patch"
     git am ${patch} >> ${logfile_basename}-am.log 2>&1
-    egrep "^Patch failed at" ${logfile_basename}-am.log > /dev/null
-    if [ $? -eq 0 ]; then
+    if [ $? -ne 0 ]; then
         cat ${logfile_basename}-am.log
-        git am --abort || exit 1
+        git am --abort
         git checkout . || exit 1
         git clean -xdf || exit 1
         git am --3way ${patch} >> ${logfile_basename}-am-3way.log 2>&1
-        egrep "^Patch failed at" ${logfile_basename}-am-3way.log > /dev/null
-        if [ $? -eq 0 ]; then
+        if [ $? -ne 0 ]; then
             cat ${logfile_basename}-am-3way.log
             echo "  Error: Patch failed to apply"
-            git am --abort || exit 1
+            git am --abort
             git checkout . || exit 1
             git clean -xdf || exit 1
             popd > /dev/null
-- 
1.9.1

_______________________________________________
lng-odp mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to