This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-releases.git


The following commit(s) were added to refs/heads/main by this push:
     new f4d7dd38 Improve curl download scripting
f4d7dd38 is described below

commit f4d7dd38bcfc63caacbb8c670ee05527cc4ba690
Author: Dave Fisher <[email protected]>
AuthorDate: Fri Feb 20 13:09:52 2026 -0800

    Improve curl download scripting
---
 atr/get/download.py             | 2 ++
 atr/static/sh/download-urls.sh  | 5 +++--
 atr/templates/download-all.html | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/atr/get/download.py b/atr/get/download.py
index e9114245..08b334f0 100644
--- a/atr/get/download.py
+++ b/atr/get/download.py
@@ -85,6 +85,8 @@ async def sh_selected(session: web.Committer | None, 
project_name: str, version_
         content = await f.read()
     download_urls_selected = util.as_url(urls_selected, 
project_name=project_name, version_name=version_name)
     download_path = util.as_url(path, project_name=project_name, 
version_name=version_name, file_path="")
+    curl_options = "--insecure" if util.is_dev_environment() else "--proto 
'=https' --tlsv1.2"
+    content = content.replace("[CURL_EXTRA]", curl_options)
     content = content.replace("[URL_OF_URLS]", 
f"https://{app_host}{download_urls_selected}";)
     content = content.replace("[URLS_PREFIX]", 
f"https://{app_host}{download_path}";)
     return web.ShellResponse(content)
diff --git a/atr/static/sh/download-urls.sh b/atr/static/sh/download-urls.sh
index bb333ad3..c7c4342e 100755
--- a/atr/static/sh/download-urls.sh
+++ b/atr/static/sh/download-urls.sh
@@ -2,14 +2,15 @@
 set -efu
 
 _url_of_urls="[URL_OF_URLS]"
+_curl_extra="[CURL_EXTRA]"
 
 # shellcheck disable=SC2086
-curl ${CURL_EXTRA:-} -fsS "$_url_of_urls" | while IFS= read -r _url_and_path
+curl ${_curl_extra} -fsS "$_url_of_urls" | while IFS= read -r _url_and_path
 do
   _url=${_url_and_path%% *}
   _path=${_url_and_path#* }
 
   printf "Downloading %s\n" "$_path" || :
   # shellcheck disable=SC2086
-  curl ${CURL_EXTRA:-} --create-dirs -fsS "$_url" -o "$_path"
+  curl ${_curl_extra} --create-dirs -fsS "$_url" -o "$_path"
 done
diff --git a/atr/templates/download-all.html b/atr/templates/download-all.html
index 7e0ebe73..5a5e4b22 100644
--- a/atr/templates/download-all.html
+++ b/atr/templates/download-all.html
@@ -95,7 +95,7 @@
   <p>You can download all of the files in this release using curl with the 
following command:</p>
   <!-- TODO: Add a button to copy the command to the clipboard -->
   <pre class="bg-light border rounded p-3 mb-3">
-curl{% if server_domain == "localhost.apache.org" %} --insecure{% endif %} 
-fsS https://{{ server_host }}{{ as_url(get.download.sh_selected, 
project_name=release.project.name, version_name=release.version) }} |{% if 
server_domain == "localhost.apache.org" %} CURL_EXTRA=--insecure{% endif %} sh
+curl{% if server_domain == "localhost.apache.org" %} --insecure{% endif %} 
-fsS https://{{ server_host }}{{ as_url(get.download.sh_selected, 
project_name=release.project.name, version_name=release.version) }} | sh
 </pre>
   <p>
     This downloads the files into the <em>current directory</em>. Ensure that 
you create a new empty directory, and change to it, before running the command. 
The script requires curl and a POSIX compliant version of sh. It works by 
downloading a POSIX complaint shell script straight into your shell. You can of 
course <a href="{{ as_url(get.download.sh_selected, 
project_name=release.project.name, version_name=release.version) }}">download 
the script</a> and audit it before running it.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to