1 Star 0 Fork 1

Damien Nguyen / boost-source-code

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
update_boost.sh 1.76 KB
Copy Edit Raw Blame History
Damien Nguyen authored 2022-11-01 10:56 . Update bash script
#! /bin/bash
# ==============================================================================
BASEPATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}" )" &> /dev/null && pwd )
ROOTDIR="$BASEPATH"
BOOST_URL_BASE='https://boostorg.jfrog.io/artifactory/main/release/'
# ==============================================================================
function usage() {
echo 'Usage:'
echo " $0 [version-triple] [linux|win]"
echo "Example: $0 1.78.0 linux"
exit 1
}
if [ $# -lt 1 ]; then
echo 'Missing argument: Boost version (e.g. 1.78.0)' 1>&2
usage
exit 1
fi
if [ $# -lt 2 ]; then
echo 'Missing argument: platform (either "linux" or "win"' 1>&2
usage
exit 1
fi
VER=$1
shift
_ver=${VER//./_}
platform=$1
shift
# ==============================================================================
cd "$BASEPATH"
# ------------------------------------------------------------------------------
if [[ "$platform" == 'linux' ]]; then
boost_archive="boost_${_ver}.tar.gz"
elif [[ "$platform" == 'win' ]]; then
boost_archive="boost_${_ver}.zip"
else
echo "Unsupported value for 'platform': $platform"
exit 1
fi
if [ ! -f "$BASEPATH/$boost_archive" ]; then
echo "Downloading $boost_archive"
wget "$BOOST_URL_BASE/${VER}/source/${boost_archive}"
else
echo "$boost_archive already present in $BASEPATH"
fi
# ------------------------------------------------------------------------------
if [[ "$platform" == 'linux' ]]; then
tar zxf "$boost_archive" --strip-components=1
elif [[ "$platform" == 'win' ]]; then
unzip -qo "$boost_archive"
src_dir="boost_${_ver}"
rsync -a "${src_dir}"/* .
rm -rf "${src_dir}"
fi
rm "$boost_archive"
# ==============================================================================
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/dnguyen/boost-source-code.git
git@gitee.com:dnguyen/boost-source-code.git
dnguyen
boost-source-code
boost-source-code
master

Search

344bd9b3 5694891 D2dac590 5694891