Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A5830C36D for ; Fri, 6 Jul 2012 20:05:13 +0000 (UTC) Received: (qmail 25840 invoked by uid 500); 6 Jul 2012 20:05:13 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 25770 invoked by uid 500); 6 Jul 2012 20:05:13 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 25763 invoked by uid 99); 6 Jul 2012 20:05:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2012 20:05:13 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jul 2012 20:05:11 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 4852F23888EA for ; Fri, 6 Jul 2012 20:04:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1358394 - in /hadoop/common/trunk/dev-support: smart-apply-patch.sh test-patch.sh Date: Fri, 06 Jul 2012 20:04:52 -0000 To: common-commits@hadoop.apache.org From: jeagles@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120706200452.4852F23888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jeagles Date: Fri Jul 6 20:04:51 2012 New Revision: 1358394 URL: http://svn.apache.org/viewvc?rev=1358394&view=rev Log: HADOOP-8523. test-patch.sh doesn't validate patches before building (Jack Dintruff via jeagles) Modified: hadoop/common/trunk/dev-support/smart-apply-patch.sh hadoop/common/trunk/dev-support/test-patch.sh Modified: hadoop/common/trunk/dev-support/smart-apply-patch.sh URL: http://svn.apache.org/viewvc/hadoop/common/trunk/dev-support/smart-apply-patch.sh?rev=1358394&r1=1358393&r2=1358394&view=diff ============================================================================== --- hadoop/common/trunk/dev-support/smart-apply-patch.sh (original) +++ hadoop/common/trunk/dev-support/smart-apply-patch.sh Fri Jul 6 20:04:51 2012 @@ -14,6 +14,7 @@ set -e PATCH_FILE=$1 +DRY_RUN=$2 if [ -z "$PATCH_FILE" ]; then echo usage: $0 patch-file exit 1 @@ -100,6 +101,11 @@ else cleanup 1; fi +# If this is a dry run then exit instead of applying the patch +if [[ -n $DRY_RUN ]]; then + cleanup 0; +fi + echo Going to apply patch with: $PATCH -p$PLEVEL $PATCH -p$PLEVEL -E < $PATCH_FILE Modified: hadoop/common/trunk/dev-support/test-patch.sh URL: http://svn.apache.org/viewvc/hadoop/common/trunk/dev-support/test-patch.sh?rev=1358394&r1=1358393&r2=1358394&view=diff ============================================================================== --- hadoop/common/trunk/dev-support/test-patch.sh (original) +++ hadoop/common/trunk/dev-support/test-patch.sh Fri Jul 6 20:04:51 2012 @@ -207,7 +207,7 @@ checkout () { } ############################################################################### -setup () { +downloadPatch () { ### Download latest patch file (ignoring .htm and .html) when run from patch process if [[ $JENKINS == "true" ]] ; then $WGET -q -O $PATCH_DIR/jira http://issues.apache.org/jira/browse/$defect @@ -240,6 +240,25 @@ setup () { cleanupAndExit 0 fi fi +} + +############################################################################### +verifyPatch () { + # Before building, check to make sure that the patch is valid + $bindir/smart-apply-patch.sh $PATCH_DIR/patch dryrun + if [[ $? != 0 ]] ; then + echo "PATCH APPLICATION FAILED" + JIRA_COMMENT="$JIRA_COMMENT + + -1 patch. The patch command could not apply the patch." + return 1 + else + return 0 + fi +} + +############################################################################### +buildWithPatch () { echo "" echo "" echo "======================================================================" @@ -886,9 +905,15 @@ if [[ $JENKINS == "true" ]] ; then exit 100 fi fi -setup +downloadPatch +verifyPatch +(( RESULT = RESULT + $? )) +if [[ $RESULT != 0 ]] ; then + submitJiraComment 1 + cleanupAndExit 1 +fi +buildWithPatch checkAuthor -RESULT=$? if [[ $JENKINS == "true" ]] ; then cleanUpXml @@ -896,7 +921,8 @@ fi checkTests (( RESULT = RESULT + $? )) applyPatch -if [[ $? != 0 ]] ; then +(( RESULT = RESULT + $? )) +if [[ $RESULT != 0 ]] ; then submitJiraComment 1 cleanupAndExit 1 fi