Skip to content

Commit

Permalink
KNOX-750 - Change test-patch to attempt -p0 and -p1 patches before fa…
Browse files Browse the repository at this point in the history
…iling
  • Loading branch information
Larry McCay committed Sep 2, 2016
1 parent b15b65f commit fb05879
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions dev-support/test-patch
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit fb05879

Please sign in to comment.