YETUS-364. make building source archive POSIX-compliant

Signed-off-by: Allen Wittenauer <[email protected]>


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

Branch: refs/heads/YETUS-379
Commit: da6e19831528543249176b7a5d7abe4c123e3d72
Parents: 11699e8
Author: Kengo Seki <[email protected]>
Authored: Sun Apr 24 10:47:42 2016 +0900
Committer: Allen Wittenauer <[email protected]>
Committed: Tue May 3 07:47:56 2016 -0700

----------------------------------------------------------------------
 build.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/da6e1983/build.sh
----------------------------------------------------------------------
diff --git a/build.sh b/build.sh
index d5f3904..bed4e3b 100755
--- a/build.sh
+++ b/build.sh
@@ -56,8 +56,8 @@ function detect_dependencies
     exit_code=1
   fi
 
-  if [ "${is_release}" = "true" ] && ! [ -x "$(command -v bsdtar)" ]; then
-    echo "building the release source archive requires the 'bsdtar' command." 
>&2
+  if [ "${is_release}" = "true" ] && ! [ -x "$(command -v pax)" ]; then
+    echo "building the release source archive requires the 'pax' command." >&2
     exit_code=1
   fi
 
@@ -119,9 +119,10 @@ if [ "${release}" = "true" ]; then
   fi
   echo "creating source tarball at '$(pwd)/target/'"
   rm "target/yetus-${YETUS_VERSION}-src".tar* 2>/dev/null || true
+  pax -w -f "target/yetus-${YETUS_VERSION}-src.tar" -s 
"/target/yetus-${YETUS_VERSION}/" target/RELEASENOTES.md target/CHANGES.md
   current=$(basename "$(pwd)")
-  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
+  #shellcheck disable=SC2038
+  (cd ..; find "${current}" \( -name target -o -name publish -o -name .git \) 
-prune -o ! -type d -print | xargs pax -w -a -f 
"${current}/target/yetus-${YETUS_VERSION}-src.tar" -s 
"/${current}/yetus-${YETUS_VERSION}/")
   gzip "target/yetus-${YETUS_VERSION}-src.tar"
 fi
 

Reply via email to