yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnaur...@apache.org
Subject yetus git commit: YETUS-281. hadoop: use built-in dependency order (addendum)
Date Fri, 12 Feb 2016 16:45:00 GMT
Repository: yetus
Updated Branches:
  refs/heads/master 7598fdfcf -> e07c92605


YETUS-281. hadoop: use built-in dependency order (addendum)

Signed-off-by: Chris Nauroth <cnauroth@apache.org>


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

Branch: refs/heads/master
Commit: e07c92605df073238436da1d01ee81daa4b7a860
Parents: 7598fdf
Author: Allen Wittenauer <aw@apache.org>
Authored: Fri Feb 12 07:37:19 2016 -0800
Committer: Chris Nauroth <cnauroth@apache.org>
Committed: Fri Feb 12 08:44:34 2016 -0800

----------------------------------------------------------------------
 precommit/personality/hadoop.sh | 36 ++++++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/e07c9260/precommit/personality/hadoop.sh
----------------------------------------------------------------------
diff --git a/precommit/personality/hadoop.sh b/precommit/personality/hadoop.sh
index 9d6f6cd..1fc0295 100755
--- a/precommit/personality/hadoop.sh
+++ b/precommit/personality/hadoop.sh
@@ -32,9 +32,25 @@ function personality_globals
   PYLINT_OPTIONS="--indent-string='  '"
 }
 
+function hadoop_order
+{
+  declare ordering=$1
+  declare hadoopm
+
+  if [[ ${ordering} = normal ]]; then
+    hadoopm=${CHANGED_MODULES}
+  elif  [[ ${ordering} = union ]]; then
+    hadoopm=${CHANGED_UNION_MODULES}
+  else
+    hadoopm="${ordering}"
+  fi
+  echo "${hadoopm}"
+}
+
 function hadoop_unittest_prereqs
 {
-  declare mods=("$@")
+  declare input=$1
+  declare mods
   declare need_common=0
   declare building_common=0
   declare module
@@ -44,11 +60,10 @@ function hadoop_unittest_prereqs
   # prior to running unit tests, hdfs needs libhadoop.so built
   # if we're building root, then this extra work is moot
 
-  # if module handling is ever put into arrays (YETUS-300)
-  # undo this disable and quote the array
+  #shellcheck disable=SC2086
+  mods=$(hadoop_order ${input})
 
-  #shellcheck disable=SC2068
-  for module in ${mods[@]}; do
+  for module in ${mods}; do
     if [[ ${module} = hadoop-hdfs-project* ]]; then
       need_common=1
     elif [[ ${module} = hadoop-common-project/hadoop-common
@@ -132,6 +147,7 @@ function personality_modules
   declare flags
   declare fn
   declare i
+  declare hadoopm
 
   yetus_debug "Personality: ${repostatus} ${testtype}"
 
@@ -244,15 +260,7 @@ function personality_modules
 
   extra="-Ptest-patch ${extra}"
 
-  if [[ ${ordering} = normal ]]; then
-    HADOOP_MODULES=${CHANGED_MODULES}
-  elif  [[ ${ordering} = union ]]; then
-    HADOOP_MODULES=${CHANGED_UNION_MODULES}
-  else
-    HADOOP_MODULES="${ordering}"
-  fi
-
-  for module in ${HADOOP_MODULES}; do
+  for module in $(hadoop_order ${ordering}); do
     # shellcheck disable=SC2086
     personality_enqueue_module ${module} ${extra}
   done


Mime
View raw message