]> git.proxmox.com Git - ceph.git/blame - ceph/src/arrow/ci/scripts/util_download_apache.sh
import quincy 17.2.0
[ceph.git] / ceph / src / arrow / ci / scripts / util_download_apache.sh
CommitLineData
1d09f67e
TL
1#!/usr/bin/env bash
2# Licensed to the Apache Software Foundation (ASF) under one
3# or more contributor license agreements. See the NOTICE file
4# distributed with this work for additional information
5# regarding copyright ownership. The ASF licenses this file
6# to you under the Apache License, Version 2.0 (the
7# "License"); you may not use this file except in compliance
8# with the License. You may obtain a copy of the License at
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing,
13# software distributed under the License is distributed on an
14# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15# KIND, either express or implied. See the License for the
16# specific language governing permissions and limitations
17# under the License.
18
19set -x
20
21if [ "$#" -ne 2 ]; then
22 echo "Usage: $0 <apache tarball path> <target directory>"
23 exit 1
24fi
25
26tarball_path=$1
27target_dir=$2
28
29APACHE_MIRRORS=(
30 "http://www.apache.org/dyn/closer.cgi?action=download&filename="
31 "https://downloads.apache.org"
32 "https://apache.claz.org"
33 "https://apache.cs.utah.edu"
34 "https://apache.mirrors.lucidnetworks.net"
35 "https://apache.osuosl.org"
36 "https://ftp.wayne.edu/apache"
37 "https://mirror.olnevhost.net/pub/apache"
38 "https://mirrors.gigenet.com/apache"
39 "https://mirrors.koehn.com/apache"
40 "https://mirrors.ocf.berkeley.edu/apache"
41 "https://mirrors.sonic.net/apache"
42 "https://us.mirrors.quenda.co/apache"
43)
44
45mkdir -p "${target_dir}"
46
47for mirror in ${APACHE_MIRRORS[*]}
48do
49 curl -SL "${mirror}/${tarball_path}" | tar -xzf - -C "${target_dir}"
50 if [ $? == 0 ]; then
51 exit 0
52 fi
53done
54
55exit 1