You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aw...@apache.org on 2015/07/10 17:38:37 UTC

[1/3] hadoop git commit: HADOOP-12188. javac warning file is always empty on ant-based projects (Kengo Seki via aw)

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))


[2/3] hadoop git commit: HADOOP-12206. The preceding invocations of findlargest in test-patch effect the following invocation results (Kengo Seki via aw)

Posted by aw...@apache.org.
HADOOP-12206. The preceding invocations of findlargest in test-patch effect the following invocation results (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/2253f1f8
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2253f1f8
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2253f1f8

Branch: refs/heads/HADOOP-12111
Commit: 2253f1f8fff00f919e526c5004b5b54afd3bff35
Parents: ccc25a9
Author: Allen Wittenauer <aw...@apache.org>
Authored: Fri Jul 10 08:27:00 2015 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Fri Jul 10 08:27:00 2015 -0700

----------------------------------------------------------------------
 dev-support/test-patch.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2253f1f8/dev-support/test-patch.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh
index 3cb2b4b..8e139d3 100755
--- a/dev-support/test-patch.sh
+++ b/dev-support/test-patch.sh
@@ -465,11 +465,13 @@ function findlargest
   local a=("$@")
   local sizeofa=${#a[@]}
   local i=0
+  local string
+  local maxlen=0
 
-  until [[ ${i} -gt ${sizeofa} ]]; do
+  until [[ ${i} -eq ${sizeofa} ]]; do
     # shellcheck disable=SC2086
     string=$( echo ${a[$i]} | cut -f$((column + 1)) -d\| )
-    if [[ ${#string} -gt $maxlen ]]; then
+    if [[ ${#string} -gt ${maxlen} ]]; then
       maxlen=${#string}
     fi
     i=$((i+1))


[3/3] hadoop git commit: HADOOP-12199. Optimize find_changed_modules (Kengo Seki via aw)

Posted by aw...@apache.org.
HADOOP-12199. Optimize find_changed_modules (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/5e42d11f
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5e42d11f
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5e42d11f

Branch: refs/heads/HADOOP-12111
Commit: 5e42d11fb53ca56001a30aa09c172317a20ba8fd
Parents: 2253f1f
Author: Allen Wittenauer <aw...@apache.org>
Authored: Fri Jul 10 08:29:57 2015 -0700
Committer: Allen Wittenauer <aw...@apache.org>
Committed: Fri Jul 10 08:29:57 2015 -0700

----------------------------------------------------------------------
 dev-support/test-patch.sh | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e42d11f/dev-support/test-patch.sh
----------------------------------------------------------------------
diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh
index 8e139d3..4b6b263 100755
--- a/dev-support/test-patch.sh
+++ b/dev-support/test-patch.sh
@@ -1006,9 +1006,7 @@ function parse_args
 ## @return       directory containing the pom.xml. Nothing returned if not found.
 function find_pomxml_dir
 {
-  local dir
-
-  dir=$(dirname "$1")
+  local dir=$1
 
   yetus_debug "Find pom.xml dir for: ${dir}"
 
@@ -1033,9 +1031,7 @@ function find_pomxml_dir
 ## @return       directory containing the build.xml. Nothing returned if not found.
 function find_buildxml_dir
 {
-  local dir
-
-  dir=$(dirname "$1")
+  local dir=$1
 
   yetus_debug "Find build.xml dir for: ${dir}"
 
@@ -1076,18 +1072,21 @@ function find_changed_files
 ## @return       None; sets ${CHANGED_MODULES} and ${CHANGED_UNFILTERED_MODULES}
 function find_changed_modules
 {
-  # Come up with a list of changed files into ${TMP}
+  local i
+  local changed_dirs
   local pomdirs
   local pomdir
   local module
   local pommods
 
+  changed_dirs=$(for i in ${CHANGED_FILES}; do dirname "${i}"; done | sort -u)
+
   # Now find all the modules that were changed
-  for file in ${CHANGED_FILES}; do
+  for i in ${changed_dirs}; do
     case ${BUILDTOOL} in
       maven)
         #shellcheck disable=SC2086
-        pomdir=$(find_pomxml_dir ${file})
+        pomdir=$(find_pomxml_dir ${i})
         if [[ -z ${pomdir} ]]; then
           output_to_console 1
           output_to_bugsystem 1
@@ -1097,7 +1096,7 @@ function find_changed_modules
       ;;
       ant)
         #shellcheck disable=SC2086
-        pomdir=$(find_buildxml_dir ${file})
+        pomdir=$(find_buildxml_dir ${i})
         if [[ -z ${pomdir} ]]; then
           output_to_console 1
           output_to_bugsystem 1