From ad5ddb51c474209fb347518c111b97121fd4bf95 Mon Sep 17 00:00:00 2001 From: scturtle Date: Wed, 7 Feb 2018 15:48:09 +0800 Subject: [PATCH] before_deploy.sh maxOS support --- ci/before_deploy.sh | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ci/before_deploy.sh b/ci/before_deploy.sh index 6a6a8ad4..c5241dac 100755 --- a/ci/before_deploy.sh +++ b/ci/before_deploy.sh @@ -1,17 +1,20 @@ #!/usr/bin/env bash -root=$(realpath "$(dirname "$0")/..") +root=$(cd "$(dirname "$0")/.."; pwd) version=$(TZ=UTC date +v%Y%m%d) cd "$root/build/release" case $(uname -s) in Darwin) libclang=(lib/clang+llvm-*/lib/libclang.dylib) + strip_option="-x" name=cquery-$version-x86_64-apple-darwin ;; FreeBSD) libclang=(lib/clang+llvm-*/lib/libclang.so.?) + strip_option="-s" name=cquery-$version-x86_64-unknown-freebsd10 ;; Linux) libclang=(lib/clang+llvm-*/lib/libclang.so.?) + strip_option="-s" name=cquery-$version-x86_64-unknown-linux-gnu ;; *) echo Unsupported >&2 @@ -19,18 +22,20 @@ case $(uname -s) in esac pkg=$(mktemp -d) -rsync -rtLR bin "./${libclang[0]}" ./lib/clang+llvm-*/lib/clang/*/include "$pkg/" +mkdir "$pkg/$name" +rsync -rtLR bin "./${libclang[0]}" ./lib/clang+llvm-*/lib/clang/*/include "$pkg/$name" cd "$pkg" -strip -s bin/cquery "${libclang[0]}" +strip "$strip_option" "$name/bin/cquery" "$name/${libclang[0]}" case $(uname -s) in Darwin) - # FIXME - ;; + tar -cf filelist --format=mtree --options="!all,time,mode,type" "$name" + awk '/#mtree/{print;print "/set uid=0 gid=0";next}1' filelist > newflielist + tar -zcf "$root/build/$name.tar.gz" @newflielist ;; Linux) # ./bin/cquery -> $name/bin/cquery - tar -Jcf "$root/build/$name.tar.xz" --owner 0 --group 0 --xform "s,^\./,$name/," . ;; + tar -Jcf "$root/build/$name.tar.xz" --owner 0 --group 0 $name ;; *) - tar -Jcf "$root/build/$name.tar.xz" --uid 0 --gid 0 -s ",^\./,$name/," . + tar -Jcf "$root/build/$name.tar.xz" --uid 0 --gid 0 $name ;; esac rm -r "$pkg"