You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by lm...@apache.org on 2016/09/02 19:12:14 UTC

knox git commit: KNOX-750 - Change test-patch to attempt -p0 and -p1 patches before failing

Repository: knox
Updated Branches:
  refs/heads/master b15b65f4d -> fb0587976


KNOX-750 - Change test-patch to attempt -p0 and -p1 patches before failing

Project: http://git-wip-us.apache.org/repos/asf/knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/knox/commit/fb058797
Tree: http://git-wip-us.apache.org/repos/asf/knox/tree/fb058797
Diff: http://git-wip-us.apache.org/repos/asf/knox/diff/fb058797

Branch: refs/heads/master
Commit: fb0587976c8a5198b57f3d17c27703f39af01f52
Parents: b15b65f
Author: Larry McCay <lm...@hortonworks.com>
Authored: Fri Sep 2 15:11:34 2016 -0400
Committer: Larry McCay <lm...@hortonworks.com>
Committed: Fri Sep 2 15:11:34 2016 -0400

----------------------------------------------------------------------
 dev-support/test-patch | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/fb058797/dev-support/test-patch
----------------------------------------------------------------------
diff --git a/dev-support/test-patch b/dev-support/test-patch
index d60a20a..f825466 100755
--- a/dev-support/test-patch
+++ b/dev-support/test-patch
@@ -278,18 +278,24 @@ applyPatch() {
     echo "" >> $STDOUT
     patch -f -E --dry-run -p0 --verbose < ${PATCHFILE} | tee ${REPORTDIR}/APPLY-PATCH.txt >> $STDOUT
     if [[  ${PIPESTATUS[0]} != 0 ]] ; then
-        echo "Patch failed to apply to head of branch"
-        echo "{color:red}-1{color} Patch failed to apply to head of branch" >> ${SUMMARYFILE}
-        echo "" >> ${SUMMARYFILE}
-        echo "----------------------------" >> ${SUMMARYFILE}
-        echo
-        cleanupAndExit 1
+        patch -f -E --dry-run -p1 --verbose < ${PATCHFILE} | tee ${REPORTDIR}/APPLY-PATCH.txt >> $STDOUT
+        if [[  ${PIPESTATUS[0]} != 0 ]] ; then
+          echo "Patch failed to apply to head of branch"
+          echo "{color:red}-1{color} Patch failed to apply to head of branch" >> ${SUMMARYFILE}
+          echo "" >> ${SUMMARYFILE}
+          echo "----------------------------" >> ${SUMMARYFILE}
+          echo
+          cleanupAndExit 1
+        fi
     fi
     patch -f -E -p0 < ${PATCHFILE} > ${REPORTDIR}/APPLY-PATCH.txt
     if [[ $? != 0 ]] ; then
-        echo "ODD!, dry run passed, but patch failed to apply to head of branch"
-        echo
-        cleanupAndExit 1
+        patch -f -E -p1 < ${PATCHFILE} > ${REPORTDIR}/APPLY-PATCH.txt
+        if [[ $? != 0 ]] ; then
+          echo "ODD!, dry run passed, but patch failed to apply to head of branch"
+          echo
+          cleanupAndExit 1
+        fi
     fi
     echo "" >> $STDOUT
     echo "Patch applied"