From 230229a492ea161276d7b730e82d229ac107f805 Mon Sep 17 00:00:00 2001 From: z4yx Date: Wed, 25 Mar 2020 09:31:22 +0800 Subject: [PATCH] sync script for ros2 --- ros2.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ros2.sh diff --git a/ros2.sh b/ros2.sh new file mode 100644 index 0000000..ee40e43 --- /dev/null +++ b/ros2.sh @@ -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"