You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@yetus.apache.org by aw...@apache.org on 2019/04/23 15:34:45 UTC

[yetus] branch master updated: YETUS-343. Missing words in test-patch.sh usage message

This is an automated email from the ASF dual-hosted git repository.

aw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/master by this push:
     new dc129a6  YETUS-343. Missing words in test-patch.sh usage message
dc129a6 is described below

commit dc129a654c85db8132461cac91a8cd681fbfe919
Author: Allen Wittenauer <aw...@apache.org>
AuthorDate: Fri Apr 19 12:10:48 2019 -0700

    YETUS-343. Missing words in test-patch.sh usage message
    
    Signed-off-by: Allen Wittenauer <aw...@apache.org>
---
 precommit/src/main/shell/core.d/00-yetuslib.sh | 21 +++++++++++++++++++++
 precommit/src/main/shell/core.d/01-common.sh   |  2 +-
 precommit/src/main/shell/test-patch.sh         | 17 ++++++++++-------
 3 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/precommit/src/main/shell/core.d/00-yetuslib.sh b/precommit/src/main/shell/core.d/00-yetuslib.sh
index 5673004..c86bc71 100755
--- a/precommit/src/main/shell/core.d/00-yetuslib.sh
+++ b/precommit/src/main/shell/core.d/00-yetuslib.sh
@@ -233,6 +233,27 @@ function yetus_comma_to_array
   IFS="${oldifs}"
 }
 
+## @description  Convert an array to a comma-delimited string
+## @audience     public
+## @stability    evolving
+## @replaceable  no
+## @param        arrayname
+## @param        string
+function yetus_array_to_comma
+{
+  declare arrname=$1
+  declare element
+  declare str
+
+  declare arrref="${arrname}[@]"
+  declare array=("${!arrref}")
+
+  for element in "${array[@]}"; do
+    str="${str},${element}"
+  done
+  echo "${str:1}"
+}
+
 ## @description  Convert a file to an array.
 ## @description  Comments on the beginning of the line are stripped.
 ## @audience     public
diff --git a/precommit/src/main/shell/core.d/01-common.sh b/precommit/src/main/shell/core.d/01-common.sh
index a79b404..8ced491 100755
--- a/precommit/src/main/shell/core.d/01-common.sh
+++ b/precommit/src/main/shell/core.d/01-common.sh
@@ -26,7 +26,7 @@ function common_defaults
   BASEDIR=$(pwd)
   BUGSYSTEMS=()
   BUILDTOOL=""
-  BUILDTOOLS=()
+  BUILDTOOLS=('nobuild')
   #shellcheck disable=SC2034
   EXEC_MODES=()
   #shellcheck disable=SC2034
diff --git a/precommit/src/main/shell/test-patch.sh b/precommit/src/main/shell/test-patch.sh
index 3578023..2019e17 100755
--- a/precommit/src/main/shell/test-patch.sh
+++ b/precommit/src/main/shell/test-patch.sh
@@ -645,14 +645,17 @@ function yetus_usage
 {
   declare bugsys
   declare jdktlist
+  declare buildtools
 
   importplugins
 
-  bugsys="${BUGSYSTEMS[*]}"
-  bugsys=${bugsys// /,}
+  bugsys=$(yetus_array_to_comma BUGSYSTEMS )
+  jdktlist=$(yetus_array_to_comma JDK_TEST_LIST )
+  buildtools=$(yetus_array_to_comma BUILDTOOLS )
 
-  jdktlist="${JDK_TEST_LIST[*]}"
-  jdktlist=${jdktlist// /,}
+  bugsys=${bugsys:-"None: no plugins enabled"}
+  jdktlist=${jdktlist:-"None: no plugins enabled"}
+  buildtools=${buildtools:-"None: no plugins enabled"}
 
   if [[ "${BUILDMODE}" = patch ]]; then
     echo "${BINNAME} [OPTIONS] patch"
@@ -666,12 +669,12 @@ function yetus_usage
   echo "Options:"
   echo ""
   yetus_add_option "--archive-list=<list>" "Comma delimited list of pattern matching notations to copy to patch-dir"
-  yetus_add_option "--basedir=<dir>" "The directory to apply the patch to (default current directory)"
+  yetus_add_option "--basedir=<dir>" "The directory to apply the patch to (default: current directory)"
   yetus_add_option "--branch=<ref>" "Forcibly set the branch"
   yetus_add_option "--branch-default=<ref>" "If the branch isn't forced and we don't detect one in the patch name, use this branch (default 'master')"
   yetus_add_option "--build-native=<bool>" "If true, then build native components (default 'true')"
   # shellcheck disable=SC2153
-  yetus_add_option "--build-tool=<tool>" "Pick which build tool to focus around (one of ${BUILDTOOLS[*]})"
+  yetus_add_option "--build-tool=<tool>" "Pick which build tool to focus around (default: autodetect from '${buildtools}')"
   yetus_add_option "--bugcomments=<bug>" "Only write comments to the screen and this comma delimited list (default: '${bugsys}')"
   yetus_add_option "--contrib-guide=<url>" "URL to point new users towards project conventions. (default: ${PATCH_NAMING_RULE} )"
   yetus_add_option "--continuous-improvement=<bool>" "If true, then do not exit with failure on branches (default: ${CONTINUOUS_IMPROVEMENT})"
@@ -682,7 +685,7 @@ function yetus_usage
   yetus_add_option "--git-offline" "Do not fail if git cannot do certain remote operations"
   yetus_add_option "--git-shallow" "Repo does not know about other branches or tags"
   yetus_add_option "--java-home=<path>" "Set JAVA_HOME (In Docker mode, this should be local to the image)"
-  yetus_add_option "--linecomments=<bug>" "Only write line comments to this comma delimited list (defaults to bugcomments)"
+  yetus_add_option "--linecomments=<bug>" "Only write line comments to this comma delimited list (default: same as --bugcomments)"
   yetus_add_option "--list-plugins" "List all installed plug-ins and then exit"
   yetus_add_option "--multijdkdirs=<paths>" "Comma delimited lists of JDK paths to use for multi-JDK tests"
   yetus_add_option "--multijdktests=<list>" "Comma delimited tests to use when multijdkdirs is used. (default: '${jdktlist}')"