yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sek...@apache.org
Subject yetus git commit: YETUS-211 version printing for precommit, shelldocs, and release-doc-maker.
Date Sat, 05 Dec 2015 15:44:22 GMT
Repository: yetus
Updated Branches:
  refs/heads/master dc29d228e -> 0cfb58cff


YETUS-211 version printing for precommit, shelldocs, and release-doc-maker.

Signed-off-by: Allen Wittenauer <aw@apache.org>
Signed-off-by: Kengo Seki <sekikn@apache.org>


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

Branch: refs/heads/master
Commit: 0cfb58cffa9eedd4294004f98558ec3431a5b7c4
Parents: dc29d22
Author: Sean Busbey <busbey@apache.org>
Authored: Fri Dec 4 00:00:08 2015 -0600
Committer: Kengo Seki <sekikn@apache.org>
Committed: Sun Dec 6 00:36:23 2015 +0900

----------------------------------------------------------------------
 VERSION                              | 1 +
 precommit/core.d/01-common.sh        | 8 ++++++++
 precommit/smart-apply-patch.sh       | 1 +
 precommit/test-patch.sh              | 6 +++++-
 release-doc-maker/releasedocmaker.py | 7 +++++++
 shelldocs/shelldocs.py               | 8 ++++++++
 6 files changed, 30 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/0cfb58cf/VERSION
----------------------------------------------------------------------
diff --git a/VERSION b/VERSION
new file mode 100644
index 0000000..b694fe3
--- /dev/null
+++ b/VERSION
@@ -0,0 +1 @@
+0.1.0-SNAPSHOT

http://git-wip-us.apache.org/repos/asf/yetus/blob/0cfb58cf/precommit/core.d/01-common.sh
----------------------------------------------------------------------
diff --git a/precommit/core.d/01-common.sh b/precommit/core.d/01-common.sh
index 9e650a6..dff228a 100755
--- a/precommit/core.d/01-common.sh
+++ b/precommit/core.d/01-common.sh
@@ -93,6 +93,7 @@ function common_args
 {
   declare i
   declare showhelp=false
+  declare showversion=false
   declare version
 
   for i in "$@"; do
@@ -164,6 +165,9 @@ function common_args
       --user-plugins=*)
         USER_PLUGIN_DIR=${i#*=}
       ;;
+      --version)
+        showversion=true
+      ;;
       *)
       ;;
     esac
@@ -172,6 +176,10 @@ function common_args
     yetus_usage
     exit 0
   fi
+  if [[ ${showversion} == true ]]; then
+    cat "${BINDIR}/../VERSION"
+    exit 0
+  fi
 
   # Absolutely require v1.7.3 or higher
   # versions lower than this either have bugs with

http://git-wip-us.apache.org/repos/asf/yetus/blob/0cfb58cf/precommit/smart-apply-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/smart-apply-patch.sh b/precommit/smart-apply-patch.sh
index ec46f19..8e028f6 100755
--- a/precommit/smart-apply-patch.sh
+++ b/precommit/smart-apply-patch.sh
@@ -96,6 +96,7 @@ function yetus_usage
   echo "--project=<name>       The short name for project currently using test-patch
(default 'yetus')"
   echo "--skip-system-plugins  Do not load plugins from ${BINDIR}/test-patch.d"
   echo "--user-plugins=<dir>   A directory of user provided plugins. see test-patch.d
for examples (default empty)"
+  echo "--version              Print release version information and exit"
   echo ""
   echo "Shell binary overrides:"
   echo "--awk-cmd=<cmd>        The 'awk' command to use (default 'awk')"

http://git-wip-us.apache.org/repos/asf/yetus/blob/0cfb58cf/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index 9cc8934..0733df7 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -685,6 +685,7 @@ function yetus_usage
   echo "--test-parallel=<bool> Run multiple tests in parallel (default false in developer
mode, true in Jenkins mode)"
   echo "--test-threads=<int>   Number of tests to run in parallel (default defined
in ${PROJECT_NAME} build)"
   echo "--user-plugins=<dir>   A directory of user provided plugins. see test-patch.d
for examples (default empty)"
+  echo "--version              Print release version information and exit"
   echo ""
   echo "Shell binary overrides:"
   echo "--awk-cmd=<cmd>        The 'awk' command to use (default 'awk')"
@@ -1988,9 +1989,12 @@ function bugsystem_linecomments
 ## @replaceable  no
 function bugsystem_finalreport
 {
+  declare version
   declare bugs
 
-  add_footer_table "Powered by" "Apache Yetus   http://yetus.apache.org"
+  version=$(cat "${BINDIR}/../VERSION")
+
+  add_footer_table "Powered by" "Apache Yetus ${version}   http://yetus.apache.org"
 
   for bugs in ${BUGCOMMENTS}; do
     if declare -f ${bugs}_finalreport >/dev/null;then

http://git-wip-us.apache.org/repos/asf/yetus/blob/0cfb58cf/release-doc-maker/releasedocmaker.py
----------------------------------------------------------------------
diff --git a/release-doc-maker/releasedocmaker.py b/release-doc-maker/releasedocmaker.py
index e579efc..4e30046 100755
--- a/release-doc-maker/releasedocmaker.py
+++ b/release-doc-maker/releasedocmaker.py
@@ -449,8 +449,15 @@ def main():
                       default=False, help="use current date for unreleased versions")
     parser.add_option("-v", "--version", dest="versions", action="append", type="string",
                       help="versions in JIRA to include in releasenotes", metavar="VERSION")
+    parser.add_option("-V", dest="release_version", action="store_true", default=False,
+                      help="display version information for releasedocmaker and exit.")
     (options, _) = parser.parse_args()
 
+    if options.release_version:
+        with open(os.path.join(os.path.dirname(__file__), "../VERSION"), 'r') as ver_file:
+            print ver_file.read()
+        sys.exit(0)
+
     if options.versions is None:
         parser.error("At least one version needs to be supplied")
 

http://git-wip-us.apache.org/repos/asf/yetus/blob/0cfb58cf/shelldocs/shelldocs.py
----------------------------------------------------------------------
diff --git a/shelldocs/shelldocs.py b/shelldocs/shelldocs.py
index 7d5506f..f8f507b 100755
--- a/shelldocs/shelldocs.py
+++ b/shelldocs/shelldocs.py
@@ -15,6 +15,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import os
 import re
 import sys
 import string
@@ -221,9 +222,16 @@ def main():
      help="file to read", metavar="INFILE")
   parser.add_option("--skipprnorep", dest="skipprnorep",
      action="store_true", help="Skip Private & Not Replaceable")
+  parser.add_option("-V", "--version", dest="release_version", action="store_true", default=False,
+                    help="display version information for shelldocs and exit.")
 
   (options, args)=parser.parse_args()
 
+  if options.release_version:
+    with open(os.path.join(os.path.dirname(__file__), "../VERSION"), 'r') as ver_file:
+      print ver_file.read()
+    sys.exit(0)
+
   allfuncs=[]
   for filename in options.infile:
     with open(filename,"r") as shellcode:


Mime
View raw message