From 324b6806572061516dd6f54c7a2ddee5ba358858 Mon Sep 17 00:00:00 2001 From: Hui Yiqun Date: Sun, 20 Aug 2017 12:00:19 +0800 Subject: [PATCH] script to sync bioconductor --- bioconductor.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 bioconductor.sh diff --git a/bioconductor.sh b/bioconductor.sh new file mode 100755 index 0000000..34793ba --- /dev/null +++ b/bioconductor.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# requires: wget, rsync +# + +set -e +set -o pipefail + +UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"rsync://master.bioconductor.org"} +VERSIONS=("3.5") +RELEASE_VERSION="3.5" + +RSYNC_OPTS="-aHvh --no-o --no-g --stats --exclude .~tmp~/ --delete --delete-after --delay-updates --safe-links --timeout=120 --contimeout=120" + +USE_IPV6=${USE_IPV6:-"0"} +if [[ $USE_IPV6 == "1" ]]; then + RSYNC_OPTS="-6 ${RSYNC_OPTS}" +fi + +mkdir -p ${TUNASYNC_WORKING_DIR}/packages + +for version in ${VERSIONS[@]}; do + upstream=${UPSTREAM}:${version} + dest=${TUNASYNC_WORKING_DIR}/packages/${version} + + [ ! -d "$dest" ] && mkdir -p "$dest" + + rsync ${RSYNC_OPTS} "$upstream" "$dest" +done + +ln -sfT ${TUNASYNC_WORKING_DIR}/packages/${RELEASE_VERSION} ${TUNASYNC_WORKING_DIR}/packages/release