hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [1/3] hadoop git commit: HADOOP-12188. javac warning file is always empty on ant-based projects (Kengo Seki via aw)
Date Fri, 10 Jul 2015 15:38:37 GMT
Repository: hadoop
Updated Branches:
  refs/heads/HADOOP-12111 5b2412e86 -> 5e42d11fb


HADOOP-12188. javac warning file is always empty on ant-based projects (Kengo Seki via aw)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/ccc25a98
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/ccc25a98
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/ccc25a98

Branch: refs/heads/HADOOP-12111
Commit: ccc25a981be6f6e325be7e9c1b2d30251f1736f2
Parents: 5b2412e
Author: Allen Wittenauer <aw@apache.org>
Authored: Fri Jul 10 08:19:06 2015 -0700
Committer: Allen Wittenauer <aw@apache.org>
Committed: Fri Jul 10 08:19:06 2015 -0700

----------------------------------------------------------------------
 dev-support/test-patch.sh | 53 ++++++++++++++++++++++++++----------------
 1 file changed, 33 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/ccc25a98/dev-support/test-patch.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh
index 694a055..3cb2b4b 100755
--- a/dev-support/test-patch.sh
+++ b/dev-support/test-patch.sh
@@ -2367,7 +2367,7 @@ function count_javac_probs
   case ${BUILDTOOL} in
     maven)
       #shellcheck disable=SC2016,SC2046
-      ${AWK} 'BEGIN {total = 0} {total += 1} END {print total}' "${warningfile}"
+      ${GREP} '\[WARNING\]' "${warningfile}" | ${AWK} '{sum+=1} END {print sum}'
     ;;
     ant)
       #shellcheck disable=SC2016
@@ -2454,15 +2454,20 @@ function check_patch_javac
 
       # if it was a new module, this won't exist.
       if [[ -f "${PATCH_DIR}/branch-javac-${fn}.txt" ]]; then
-        ${GREP} '\[WARNING\]' "${PATCH_DIR}/branch-javac-${fn}.txt" \
+        ${GREP} -i warning "${PATCH_DIR}/branch-javac-${fn}.txt" \
           > "${PATCH_DIR}/branch-javac-${fn}-warning.txt"
       else
         touch "${PATCH_DIR}/branch-javac-${fn}.txt" \
           "${PATCH_DIR}/branch-javac-${fn}-warning.txt"
       fi
 
-      ${GREP} '\[WARNING\]' "${PATCH_DIR}/patch-javac-${fn}.txt" \
-        > "${PATCH_DIR}/patch-javac-${fn}-warning.txt"
+      if [[ -f "${PATCH_DIR}/patch-javac-${fn}.txt" ]]; then
+        ${GREP} -i warning "${PATCH_DIR}/patch-javac-${fn}.txt" \
+          > "${PATCH_DIR}/patch-javac-${fn}-warning.txt"
+      else
+        touch "${PATCH_DIR}/patch-javac-${fn}.txt" \
+          "${PATCH_DIR}/patch-javac-${fn}-warning.txt"
+      fi
 
       numbranch=$(count_javac_probs "${PATCH_DIR}/branch-javac-${fn}-warning.txt")
       numpatch=$(count_javac_probs "${PATCH_DIR}/patch-javac-${fn}-warning.txt")
@@ -2587,6 +2592,27 @@ function check_patch_javadoc
 
       fn=$(module_file_fragment "${MODULE[${i}]}")
       fn="${fn}${jdk}"
+      module_suffix=$(basename "${MODULE[${i}]}")
+      if [[ ${module_suffix} == \. ]]; then
+        module_suffix=root
+      fi
+
+      if [[ -f "${PATCH_DIR}/branch-javadoc-${fn}.txt" ]]; then
+        ${GREP} -i warning "${PATCH_DIR}/branch-javadoc-${fn}.txt" \
+          > "${PATCH_DIR}/branch-javadoc-${fn}-warning.txt"
+      else
+        touch "${PATCH_DIR}/branch-javadoc-${fn}.txt" \
+          "${PATCH_DIR}/branch-javadoc-${fn}-warning.txt"
+      fi
+
+      if [[ -f "${PATCH_DIR}/patch-javadoc-${fn}.txt" ]]; then
+        ${GREP} -i warning "${PATCH_DIR}/patch-javadoc-${fn}.txt" \
+          > "${PATCH_DIR}/patch-javadoc-${fn}-warning.txt"
+      else
+        touch "${PATCH_DIR}/patch-javadoc-${fn}.txt" \
+          "${PATCH_DIR}/patch-javadoc-${fn}-warning.txt"
+      fi
+
       numbranch=$(count_javadoc_probs "${PATCH_DIR}/branch-javadoc-${fn}.txt")
       numpatch=$(count_javadoc_probs "${PATCH_DIR}/patch-javadoc-${fn}.txt")
 
@@ -2594,25 +2620,12 @@ function check_patch_javadoc
           && -n ${numpatch}
           && ${numpatch} -gt ${numbranch} ]] ; then
 
-        if [[ -f "${PATCH_DIR}/branch-javadoc-${fn}.txt" ]]; then
-          ${GREP} -i warning "${PATCH_DIR}/branch-javadoc-${fn}.txt" \
-            > "${PATCH_DIR}/branch-javadoc-${fn}-filtered.txt"
-        else
-          touch "${PATCH_DIR}/branch-javadoc-${fn}.txt" \
-            "${PATCH_DIR}/branch-javadoc-${fn}-filtered.txt"
-        fi
-
-        ${GREP} -i warning "${PATCH_DIR}/patch-javadoc-${fn}.txt" \
-          > "${PATCH_DIR}/patch-javadoc-${fn}-filtered.txt"
-
-        ${DIFF} -u "${PATCH_DIR}/branch-javadoc-${fn}-filtered.txt" \
-          "${PATCH_DIR}/patch-javadoc-${fn}-filtered.txt" \
+        ${DIFF} -u "${PATCH_DIR}/branch-javadoc-${fn}-warning.txt" \
+          "${PATCH_DIR}/patch-javadoc-${fn}-warning.txt" \
           > "${PATCH_DIR}/javadoc-${fn}-diff.txt"
-        rm -f "${PATCH_DIR}/branch-javadoc-${fn}-filtered.txt" \
-           "${PATCH_DIR}/patch-javadoc-${fn}-filtered.txt"
 
         module_status ${i} -1  "javadoc-${fn}-diff.txt" \
-          "Patched ${MODULE[${i}]} generated "\
+          "Patched ${module_suffix} generated "\
           "$((numpatch-numbranch)) additional warning messages${statusjdk}."
 
         ((result=result+1))


Mime
View raw message