hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject svn commit: r615686 - /hadoop/core/nightly/hudsonBuildHadoopPatch.sh
Date Mon, 28 Jan 2008 00:54:31 GMT
Author: nigel
Date: Sun Jan 27 16:54:30 2008
New Revision: 615686

URL: http://svn.apache.org/viewvc?rev=615686&view=rev
Log:
add license header checking to the patch process

Modified:
    hadoop/core/nightly/hudsonBuildHadoopPatch.sh

Modified: hadoop/core/nightly/hudsonBuildHadoopPatch.sh
URL: http://svn.apache.org/viewvc/hadoop/core/nightly/hudsonBuildHadoopPatch.sh?rev=615686&r1=615685&r2=615686&view=diff
==============================================================================
--- hadoop/core/nightly/hudsonBuildHadoopPatch.sh (original)
+++ hadoop/core/nightly/hudsonBuildHadoopPatch.sh Sun Jan 27 16:54:30 2008
@@ -75,14 +75,15 @@
   echo ""
   echo "======================================================================"
   echo "======================================================================"
-  echo "    Pre-building trunk to determine current"
-  echo "    number of javac and Findbugs warnings."
+  echo "    Pre-building trunk to determine trunk number"
+  echo "    of release audit, javac, and Findbugs warnings."
   echo "======================================================================"
   echo "======================================================================"
   echo ""
   echo ""
-  $ANT_HOME/bin/ant -Dversion=${SVN_REVISION}_${defect}_PATCH-${patchNum} -Dfindbugs.home=$FINDBUGS_HOME
-Djavac.args="-Xlint -Xmaxwarns 1000" -DHadoopPatchProcess= clean tar findbugs &> $PATCH_DIR/currentJavacWarnings
-  cp $WORKSPACE/trunk/build/test/findbugs/*.xml $PATCH_DIR/currentFindbugsWarnings.xml
+  $ANT_HOME/bin/ant -Dversion=${SVN_REVISION}_${defect}_PATCH-${patchNum} -DHadoopPatchProcess=
releaseaudit &> $PATCH_DIR/trunkReleaseAuditWarnings
+  $ANT_HOME/bin/ant -Dversion=${SVN_REVISION}_${defect}_PATCH-${patchNum} -Dfindbugs.home=$FINDBUGS_HOME
-Djavac.args="-Xlint -Xmaxwarns 1000" -DHadoopPatchProcess= clean tar findbugs &> $PATCH_DIR/trunkJavacWarnings
+  cp $WORKSPACE/trunk/build/test/findbugs/*.xml $PATCH_DIR/trunkFindbugsWarnings.xml
 }
 
 ###############################################################################
@@ -177,25 +178,61 @@
   echo ""
   $ANT_HOME/bin/ant -Dversion=${SVN_REVISION}_${defect}_PATCH-${patchNum} -Djavac.args="-Xlint
-Xmaxwarns 1000" -DHadoopPatchProcess= tar &> $PATCH_DIR/patchJavacWarnings
 
-  ### Compare current and patch javac warning numbers
+  ### Compare trunk and patch javac warning numbers
   if [[ -f $PATCH_DIR/patchJavacWarnings ]] ; then
-    currentJavacWarnings=`$GREP -o '\[javac\] [0-9]* warning' $PATCH_DIR/currentJavacWarnings
| awk '{total += $2} END {print total}'`
+    trunkJavacWarnings=`$GREP -o '\[javac\] [0-9]* warning' $PATCH_DIR/trunkJavacWarnings
| awk '{total += $2} END {print total}'`
     patchJavacWarnings=`$GREP -o '\[javac\] [0-9]* warning' $PATCH_DIR/patchJavacWarnings
| awk '{total += $2} END {print total}'`
     echo ""
     echo ""
-    echo "There appear to be $currentJavacWarnings javac compiler warnings before the patch
and $patchJavacWarnings javac compiler warnings after applying the patch."
-    if [[ $patchJavacWarnings != "" && $currentJavacWarnings != "" ]] ; then
-      if [[ $patchJavacWarnings > $currentJavacWarnings ]] ; then
+    echo "There appear to be $trunkJavacWarnings javac compiler warnings before the patch
and $patchJavacWarnings javac compiler warnings after applying the patch."
+    if [[ $patchJavacWarnings != "" && $trunkJavacWarnings != "" ]] ; then
+      if [[ $patchJavacWarnings > $trunkJavacWarnings ]] ; then
         JIRA_COMMENT="$JIRA_COMMENT
 
-    javac -1.  The applied patch generated $patchJavacWarnings javac compiler warnings (more
than the trunk's current $currentJavacWarnings warnings)."
+    javac -1.  The applied patch generated $patchJavacWarnings javac compiler warnings (more
than the trunk's current $trunkJavacWarnings warnings)."
         return 1
       fi
     fi
   fi
   JIRA_COMMENT="$JIRA_COMMENT
 
-    javac +1.  The applied patch does not generate any new compiler warnings."
+    javac +1.  The applied patch does not generate any new javac compiler warnings."
+  return 0
+}
+
+###############################################################################
+### Check there are no changes in the number of release audit (RAT) warnings
+checkReleaseAuditWarnings () {
+  echo ""
+  echo ""
+  echo "======================================================================"
+  echo "======================================================================"
+  echo "    Determining number of patched release audit warnings."
+  echo "======================================================================"
+  echo "======================================================================"
+  echo ""
+  echo ""
+  $ANT_HOME/bin/ant -Dversion=${SVN_REVISION}_${defect}_PATCH-${patchNum} -DHadoopPatchProcess=
releaseaudit &> $PATCH_DIR/patchReleaseAuditWarnings
+
+  ### Compare trunk and patch release audit warning numbers
+  if [[ -f $PATCH_DIR/patchReleaseAuditWarnings ]] ; then
+    trunkReleaseAuditWarnings=`$GREP -c '\!?????' $PATCH_DIR/trunkReleaseAuditWarnings`
+    patchReleaseAuditWarnings=`$GREP -c '\!?????' $PATCH_DIR/patchReleaseAuditWarnings`
+    echo ""
+    echo ""
+    echo "There appear to be $trunkReleaseAuditWarnings release audit warnings before the
patch and $patchReleaseAuditWarnings release audit warnings after applying the patch."
+    if [[ $patchReleaseAuditWarnings != "" && $trunkReleaseAuditWarnings != "" ]]
; then
+      if [[ $patchReleaseAuditWarnings > $trunkReleaseAuditWarnings ]] ; then
+        JIRA_COMMENT="$JIRA_COMMENT
+
+    release audit -1.  The applied patch generated $patchReleaseAuditWarnings release audit
warnings (more than the trunk's current $trunkReleaseAuditWarnings warnings)."
+        return 1
+      fi
+    fi
+  fi
+  JIRA_COMMENT="$JIRA_COMMENT
+
+    release audit +1.  The applied patch does not generate any new release audit warnings."
   return 0
 }
 
@@ -254,13 +291,13 @@
 $JIRA_COMMENT_FOOTER"
   cp $WORKSPACE/trunk/build/test/findbugs/*.xml $PATCH_DIR/patchFindbugsWarnings.xml
   $FINDBUGS_HOME/bin/setBugDatabaseInfo -timestamp "01/01/1999" \
-    $PATCH_DIR/currentFindbugsWarnings.xml \
-    $PATCH_DIR/currentFindbugsWarnings.xml
+    $PATCH_DIR/trunkFindbugsWarnings.xml \
+    $PATCH_DIR/trunkFindbugsWarnings.xml
   $FINDBUGS_HOME/bin/setBugDatabaseInfo -timestamp "01/01/2000" \
     $PATCH_DIR/patchFindbugsWarnings.xml \
     $PATCH_DIR/patchFindbugsWarnings.xml
   $FINDBUGS_HOME/bin/computeBugHistory -output $PATCH_DIR/findbugsMerge.xml \
-    $PATCH_DIR/currentFindbugsWarnings.xml \
+    $PATCH_DIR/trunkFindbugsWarnings.xml \
     $PATCH_DIR/patchFindbugsWarnings.xml
   findbugsWarnings=`$FINDBUGS_HOME/bin/filterBugs -first "01/01/2000" $PATCH_DIR/findbugsMerge.xml
\
     $WORKSPACE/trunk/build/test/findbugs/newPatchFindbugsWarnings.xml | /usr/bin/nawk '{print
$1}'`
@@ -371,7 +408,7 @@
 cleanupAndExit () {
   local result=$1
   if [ -e $PATCH_DIR ] ; then
-    rm -rf $PATCH_DIR
+    mv $PATCH_DIR $WORKSPACE/trunk
   fi
   echo ""
   echo ""
@@ -424,6 +461,8 @@
 checkJavadocWarnings
 (( RESULT = RESULT + $? ))
 checkJavacWarnings
+(( RESULT = RESULT + $? ))
+checkReleaseAuditWarnings
 (( RESULT = RESULT + $? ))
 checkStyle
 (( RESULT = RESULT + $? ))



Mime
View raw message