This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/master by this push:
new 463cdccdf7 MINOR: [Release] Support older versions of CURL in GitHub
downloader (#15099)
463cdccdf7 is described below
commit 463cdccdf7a1914073b29f61915018b2045bb429
Author: Will Jones <[email protected]>
AuthorDate: Wed Dec 28 12:49:13 2022 -0800
MINOR: [Release] Support older versions of CURL in GitHub downloader
(#15099)
The `--retry-all-errors` parameter is available starting in 7.71.0 - June
24 2020, while the latest curl I could install in Ubuntu 20.04 from apt-get is
7.68.0.
Authored-by: Will Jones <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
dev/release/download_rc_binaries.py | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/dev/release/download_rc_binaries.py
b/dev/release/download_rc_binaries.py
index 40829563e1..49203cd454 100755
--- a/dev/release/download_rc_binaries.py
+++ b/dev/release/download_rc_binaries.py
@@ -133,6 +133,12 @@ class Downloader:
raise Exception(f"Downloading {url} failed\n"
f"stdout: {stdout}\nstderr: {stderr}")
+ def _curl_version(self):
+ cmd = ["curl", "--version"]
+ out = subprocess.run(cmd, capture_output=True, check=True).stdout
+ match = re.search(r"curl (\d+)\.(\d+)\.(\d+) ", out.decode())
+ return (int(match.group(1)), int(match.group(2)), int(match.group(3)))
+
class Artifactory(Downloader):
URL_ROOT = "https://apache.jfrog.io/artifactory/arrow"
@@ -196,15 +202,17 @@ class GitHub(Downloader):
print(f"Waiting {delay} seconds to avoid rate limit")
time.sleep(delay)
+ extra_args = [
+ "--header",
+ "Accept: application/octet-stream",
+ ]
+ if self._curl_version() >= (7, 71, 0):
+ # Also retry 403s
+ extra_args.append("--retry-all-errors")
self._download_url(
url,
dest_path,
- extra_args=[
- "--header",
- "Accept: application/octet-stream",
- # Also retry 403s
- "--retry-all-errors",
- ],
+ extra_args=extra_args
)