You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by vi...@apache.org on 2013/02/16 00:54:19 UTC

svn commit: r1446819 - in /oozie/branches/hcat-intre/bin: test-patch test-patch-05-patch-raw-analysis

Author: virag
Date: Fri Feb 15 23:54:18 2013
New Revision: 1446819

URL: http://svn.apache.org/r1446819
Log:
Porting test-patch changes to hcat-intre

Modified:
    oozie/branches/hcat-intre/bin/test-patch
    oozie/branches/hcat-intre/bin/test-patch-05-patch-raw-analysis

Modified: oozie/branches/hcat-intre/bin/test-patch
URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/bin/test-patch?rev=1446819&r1=1446818&r2=1446819&view=diff
==============================================================================
--- oozie/branches/hcat-intre/bin/test-patch (original)
+++ oozie/branches/hcat-intre/bin/test-patch Fri Feb 15 23:54:18 2013
@@ -132,6 +132,8 @@ updateJira() {
 ###############################################################################
 cleanupAndExit() {
   updateJira
+  echo "test-patch exit code: $1"
+  echo
   exit $1
 }
 ###############################################################################
@@ -407,5 +409,5 @@ cat ${SUMMARYFILE} | sed -e 's/{color}//
 
 cat ${SUMMARYFILETXT}
 
-grep "\-1" ${SUMMARYFILE} &> /dev/null
-cleanupAndExit `expr $? = 0`
+grep "^+1 Overall result" ${SUMMARYFILETXT} &> /dev/null
+cleanupAndExit "$?"

Modified: oozie/branches/hcat-intre/bin/test-patch-05-patch-raw-analysis
URL: http://svn.apache.org/viewvc/oozie/branches/hcat-intre/bin/test-patch-05-patch-raw-analysis?rev=1446819&r1=1446818&r2=1446819&view=diff
==============================================================================
--- oozie/branches/hcat-intre/bin/test-patch-05-patch-raw-analysis (original)
+++ oozie/branches/hcat-intre/bin/test-patch-05-patch-raw-analysis Fri Feb 15 23:54:18 2013
@@ -74,7 +74,7 @@ parseArgs() {
 }
 ###############################################################################
 checkNoAuthors() {
-  authorTags=`grep "^+ " ${PATCHFILE} | grep -c -i -e ".*\*.* @author"`
+  authorTags=`grep "^+" ${PATCHFILE} | grep -v "^+++" | grep -c -i -e ".*\*.* @author"`
   if [[ ${authorTags} != 0 ]] ; then
     REPORT+=("{color:red}-1{color} the patch seems to contain ${authorTags} line(s) with @author tags")
   else
@@ -83,7 +83,7 @@ checkNoAuthors() {
 }
 ###############################################################################
 checkNoTabs() {
-  tabs=`grep "^+ " ${PATCHFILE} | grep -c -P "\t"`
+  tabs=`grep "^+" ${PATCHFILE} | grep -v "^+++" | grep -c $'\t'`
   if [[ ${tabs} != 0 ]] ; then
     REPORT+=("{color:red}-1{color} the patch contains ${tabs} line(s) with tabs")
   else
@@ -92,7 +92,7 @@ checkNoTabs() {
 }
 ###############################################################################
 checkNoTrailingSpaces() {
-  trailingSpaces=`grep "^+ " ${PATCHFILE} | grep -c -e " $"`
+  trailingSpaces=`grep "^+" ${PATCHFILE} | grep -v "^+++" | grep -c -e " $"`
   if [[ ${trailingSpaces} != 0 ]] ; then
     REPORT+=("{color:red}-1{color} the patch contains ${trailingSpaces} line(s) with trailing spaces")
   else
@@ -102,7 +102,7 @@ checkNoTrailingSpaces() {
 ###############################################################################
 checkLinesLength() {
   # We check for > 133 to account for the "+" sign
-  longLines=`grep "^+ " ${PATCHFILE} | awk 'BEGIN{count=0}{if ( length > 133 ) { count=count+1} }END{ print count}'`
+  longLines=`grep "^+" ${PATCHFILE} | grep -v "^+++" | awk 'BEGIN{count=0}{if ( length > 133 ) { count=count+1} }END{ print count}'`
   if [[ ${longLines} != 0 ]] ; then
     REPORT+=("{color:red}-1{color} the patch contains ${longLines} line(s) longer than 132 characters")
   else