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 2016/04/09 18:24:27 UTC

[04/11] yetus git commit: YETUS-358 specify bsdtar for source artifact build.

YETUS-358 specify bsdtar for source artifact build.

Signed-off-by: Marco Zuehlke <mz...@gmail.com>
Signed-off-by: Kengo Seki <se...@apache.org>


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

Branch: refs/heads/YETUS-156
Commit: d35fa80862b454cccb2a5c969794cc394e2dbcea
Parents: 26aef26
Author: Sean Busbey <bu...@apache.org>
Authored: Thu Mar 31 20:47:00 2016 -0500
Committer: Kengo Seki <se...@apache.org>
Committed: Sun Apr 3 23:56:42 2016 +0900

----------------------------------------------------------------------
 build.sh | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/d35fa808/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
index 6b23683..ebf2872 100755
--- a/build.sh
+++ b/build.sh
@@ -29,10 +29,12 @@
 ## @audience     private
 ## @stability    evolving
 ## @replaceable  no
+## @param        true iff this is a release build
 ## @return       1 - Some dependencies are missing
 ## @return       0 - All dependencies exist
 function detect_dependencies
 {
+  declare is_release=$1
   local exit_code=0
   if ! [ -x "$(command -v java)" ]; then
     echo "Java not found! Must install JDK version >= 1.7" >&2
@@ -49,6 +51,16 @@ function detect_dependencies
     exit_code=1
   fi
 
+  if ! [ -x "$(command -v tar)" ]; then
+    echo "Building archives requires the 'tar' command." >&2
+    exit_code=1
+  fi
+
+  if [ "${is_release}" = "true" ] && ! [ -x "$(command -v bsdtar)" ]; then
+    echo "building the release source archive requires the 'bsdtar' command." >&2
+    exit_code=1
+  fi
+
   if [[ "${exit_code}" -ne "0" ]]; then
     echo "Some dependencies are missing. Exit now." >&2
   fi
@@ -70,7 +82,7 @@ done
 
 echo "working on version '${YETUS_VERSION}'"
 
-detect_dependencies
+detect_dependencies "${release}"
 mkdir -p target
 
 if [ "${offline}" != "true" ]; then
@@ -106,8 +118,8 @@ if [ "${release}" = "true" ]; then
   echo "creating source tarball at '$(pwd)/target/'"
   rm "target/yetus-${YETUS_VERSION}-src".tar* 2>/dev/null || true
   current=$(basename "$(pwd)")
-  tar -s "/${current}/yetus-${YETUS_VERSION}/" -C ../ -cf "target/yetus-${YETUS_VERSION}-src.tar" --exclude '*/target/*' --exclude '*/publish/*' --exclude '*/.git/*' "${current}"
-  tar -s "/target/yetus-${YETUS_VERSION}/" -rf "target/yetus-${YETUS_VERSION}-src.tar" target/RELEASENOTES.md target/CHANGES.md
+  bsdtar -s "/${current}/yetus-${YETUS_VERSION}/" -C ../ -cf "target/yetus-${YETUS_VERSION}-src.tar" --exclude '*/target/*' --exclude '*/publish/*' --exclude '*/.git/*' "${current}"
+  bsdtar -s "/target/yetus-${YETUS_VERSION}/" -rf "target/yetus-${YETUS_VERSION}-src.tar" target/RELEASENOTES.md target/CHANGES.md
   gzip "target/yetus-${YETUS_VERSION}-src.tar"
 fi