diff --git a/ELK.sh b/ELK.sh index 42c8189..f4bc3d7 100755 --- a/ELK.sh +++ b/ELK.sh @@ -3,9 +3,7 @@ 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) +apt_sync="${_here}/apt-sync.py" BASE_PATH="${TUNASYNC_WORKING_DIR}" BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://packages.elastic.co"} @@ -33,9 +31,7 @@ for repo in "${!REPO_VERSIONS[@]}"; do echo $repo-$version apt_url="${BASE_URL}/${repo}/${version}/debian" dest_path="${APT_PATH}/${repo}/${version}" - [[ ! -d ${dest_path} ]] && mkdir -p ${dest_path} - apt-download-binary ${apt_url} "stable" "main" "amd64" "${dest_path}" || true - apt-download-binary ${apt_url} "stable" "main" "i386" "${dest_path}" || true + "$apt_sync" "$apt_url" stable main amd64,i386 "$dest_path" done done diff --git a/elastic.sh b/elastic.sh index 336ad72..76398fe 100755 --- a/elastic.sh +++ b/elastic.sh @@ -3,9 +3,7 @@ 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) +apt_sync="${_here}/apt-sync.py" BASE_URL=${TUNASYNC_UPSTREAM_URL:-"https://artifacts.elastic.co"} @@ -20,18 +18,9 @@ APT_PATH="${BASE_PATH}/apt" mkdir -p ${YUM_PATH} ${APT_PATH} # =================== APT repos =============================== -if [[ ! -z ${DRY_RUN:-} ]]; then - export APT_DRY_RUN=1 -fi for elsver in "${ELASTIC_VERSION[@]}"; do - mkdir -p ${BASE_PATH}/${elsver} - - apt_url="${BASE_URL}/packages/${elsver}/apt" - dest_path="${APT_PATH}/${elsver}" - - apt-download-binary ${apt_url} "stable" "main" "amd64" "${dest_path}" || true - apt-download-binary ${apt_url} "stable" "main" "i386" "${dest_path}" || true + "$apt_sync" "${BASE_URL}/packages/${elsver}/apt" stable main amd64,i386 "${APT_PATH}/${elsver}" (cd ${BASE_PATH}/${elsver}; ln -sf ../apt/${elsver} apt) done diff --git a/erlang.sh b/erlang.sh index 1d11fec..a4bd483 100755 --- a/erlang.sh +++ b/erlang.sh @@ -3,9 +3,7 @@ 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) +apt_sync="${_here}/apt-sync.py" BASE_PATH="${TUNASYNC_WORKING_DIR}" BASE_URL="https://packages.erlang-solutions.com" @@ -14,29 +12,12 @@ YUM_PATH="${BASE_PATH}/centos" UBUNTU_PATH="${BASE_PATH}/ubuntu" DEBIAN_PATH="${BASE_PATH}/debian" -UBUNTU_VERSIONS=("trusty" "xenial" "bionic") -DEBIAN_VERSIONS=("wheezy" "jessie" "stretch" "buster") EL_VERSIONS=("6" "7" "8") # =================== APT repos =============================== -if [[ ! -z ${DRY_RUN:-} ]]; then - export APT_DRY_RUN=1 -fi - -base_url="${BASE_URL}/ubuntu" -for version in ${UBUNTU_VERSIONS[@]}; do - for arch in "amd64" "i386"; do - apt-download-binary ${base_url} "$version" "contrib" "$arch" "${UBUNTU_PATH}" || true - done -done +"$apt_sync" "${BASE_URL}/ubuntu" @ubuntu-lts contrib amd64,i386 "$UBUNTU_PATH" echo "Ubuntu finished" - -base_url="${BASE_URL}/debian" -for version in ${DEBIAN_VERSIONS[@]}; do - for arch in "amd64" "i386"; do - apt-download-binary ${base_url} "$version" "contrib" "$arch" "${DEBIAN_PATH}" || true - done -done +"$apt_sync" "${BASE_URL}/debian" @debian-current contrib amd64,i386 "$DEBIAN_PATH" echo "Debian finished" # =================== YUM repos =============================== diff --git a/gitlab-ce.sh b/gitlab-ce.sh index 785d3aa..c85d2d4 100755 --- a/gitlab-ce.sh +++ b/gitlab-ce.sh @@ -3,9 +3,7 @@ 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) +apt_sync="${_here}/apt-sync.py" UPSTREAM=${TUNASYNC_UPSTREAM_URL:-"https://packages.gitlab.com/gitlab/gitlab-ce"} @@ -14,8 +12,6 @@ BASE_PATH="${TUNASYNC_WORKING_DIR}" YUM_PATH="${BASE_PATH}/yum" EL_VERSIONS=(6 7 8) -UBUNTU_VERSIONS=("trusty" "xenial" "bionic") -DEBIAN_VERSIONS=("wheezy" "jessie" "stretch" "buster") UBUNTU_PATH="${BASE_PATH}/ubuntu/" DEBIAN_PATH="${BASE_PATH}/debian/" @@ -49,22 +45,9 @@ if [[ -z ${DRY_RUN:-} ]]; then fi rm $cfg -if [[ ! -z ${DRY_RUN:-} ]]; then - export APT_DRY_RUN=1 -fi - -base_url="${UPSTREAM}/ubuntu" -for version in ${UBUNTU_VERSIONS[@]}; do - apt-download-binary ${base_url} "$version" "main" "amd64" "${UBUNTU_PATH}" || true - apt-download-binary ${base_url} "$version" "main" "i386" "${UBUNTU_PATH}" || true -done +"$apt_sync" "${UPSTREAM}/ubuntu" @ubuntu-lts main amd64,i386 "$UBUNTU_PATH" echo "Ubuntu finished" - -base_url="${UPSTREAM}/debian" -for version in ${DEBIAN_VERSIONS[@]}; do - apt-download-binary ${base_url} "$version" "main" "amd64" "${DEBIAN_PATH}" || true - apt-download-binary ${base_url} "$version" "main" "i386" "${DEBIAN_PATH}" || true -done +"$apt_sync" "${UPSTREAM}/debian" @debian-current main amd64,i386 "$DEBIAN_PATH" echo "Debian finished"