Author: nigel
Date: Fri Feb 25 07:06:46 2011
New Revision: 1074413
URL: http://svn.apache.org/viewvc?rev=1074413&view=rev
Log:
Fix precommit testing control script to check that control file is not corrupted
Modified:
hadoop/nightly/hudsonPatchQueueAdmin.sh
Modified: hadoop/nightly/hudsonPatchQueueAdmin.sh
URL:
http://svn.apache.org/viewvc/hadoop/nightly/hudsonPatchQueueAdmin.sh?rev=1074413&r1=1074412&r2=1074413&view=diff
==============================================================================
--- hadoop/nightly/hudsonPatchQueueAdmin.sh (original)
+++ hadoop/nightly/hudsonPatchQueueAdmin.sh Fri Feb 25 07:06:46 2011
@@ -61,6 +61,16 @@ if [[ $VERBOSE == 1 ]] ; then
set -x
fi
+### Grab the latest patch_tested.txt file from this job on Hudson
+curl --fail --location --retry 3 --output patch_tested.txt
${JOB_URL}/lastSuccessfulBuild/artifact/patch_tested.txt
+
+### Fail fast if downloaded file may be corrupted
+FIRSTLINE=`head -1 patch_tested.txt`
+if [ "$FIRSTLINE" != "TESTED ISSUES" ] ; then
+ echo "Downloaded patch_tested.txt control file may be corrupted. Failing."
+ exit 1
+fi
+
### Grab the latest patch available query from Jira
curl --fail --location --retry 3 --output patch_available.xml $FILTER
@@ -71,9 +81,6 @@ xpath -q -e "//item/key/text() | //item/
### to yield lines with pairs (issueNumber,largestAttachmentId). Example:
HADOOP-123,456984
awk '{ printf "%s", $0 }' patch_available2.elements | sed -e "s/\W*id=\"/,/g"
| sed -e "s/\"/\n/g" |tee patch_available3.txt
-### Grab the latest patch_tested.txt file from this job on Hudson
-curl --fail --location --retry 3 --output patch_tested.txt
${JOB_URL}/lastSuccessfulBuild/artifact/patch_tested.txt
-
### Iterate through issue list and find the (issueNumber,largestAttachmentId)
pairs that have
### not been tested (ie don't already exist in the patch_tested.txt file
touch patch_tested.txt