sync script for ros2

This commit is contained in:
z4yx 2020-03-25 09:31:22 +08:00
parent 6e35c9268e
commit 230229a492

30
ros2.sh Normal file
View File

@ -0,0 +1,30 @@
#!/bin/bash
# requires: wget curl
set -e
set -o pipefail
_here=`dirname $(realpath $0)`
. ${_here}/helpers/apt-download
[ -z "${LOADED_APT_DOWNLOAD}" ] && (echo "failed to load apt-download"; exit 1)
BASE_PATH="${TUNASYNC_WORKING_DIR}"
BASE_URL=${TUNASYNC_UPSTREAM_URL:-"http://packages.ros.org/ros2"}
APT_PATH="${BASE_PATH}/ubuntu"
APT_VERSIONS=(bionic buster cosmic disco eoan focal stretch xenial)
# =================== APT repos ===============================
if [[ ! -z ${DRY_RUN:-} ]]; then
export APT_DRY_RUN=1
fi
mkdir -p ${APT_PATH}
base_url="${BASE_URL}/ubuntu"
for version in ${APT_VERSIONS[@]}; do
for arch in "amd64" "arm64" "armhf"; do
echo "=== Syncing $version $arch"
apt-download-binary "${base_url}" "$version" "main" "$arch" "${APT_PATH}" || true
done
done
echo "APT finished"