You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oozie.apache.org by tu...@apache.org on 2013/02/08 00:15:38 UTC
svn commit: r1443774 - in /oozie/trunk/bin: test-patch
test-patch-05-patch-raw-analysis
Author: tucu
Date: Thu Feb 7 23:15:37 2013
New Revision: 1443774
URL: http://svn.apache.org/r1443774
Log:
Improvements to test-patch script (tucu)
Modified:
oozie/trunk/bin/test-patch
oozie/trunk/bin/test-patch-05-patch-raw-analysis
Modified: oozie/trunk/bin/test-patch
URL: http://svn.apache.org/viewvc/oozie/trunk/bin/test-patch?rev=1443774&r1=1443773&r2=1443774&view=diff
==============================================================================
--- oozie/trunk/bin/test-patch (original)
+++ oozie/trunk/bin/test-patch Thu Feb 7 23:15:37 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/trunk/bin/test-patch-05-patch-raw-analysis
URL: http://svn.apache.org/viewvc/oozie/trunk/bin/test-patch-05-patch-raw-analysis?rev=1443774&r1=1443773&r2=1443774&view=diff
==============================================================================
--- oozie/trunk/bin/test-patch-05-patch-raw-analysis (original)
+++ oozie/trunk/bin/test-patch-05-patch-raw-analysis Thu Feb 7 23:15:37 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