curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Identifying latest release...

From: Timothe Litt <litt_at_acm.org>
Date: Wed, 26 Oct 2022 11:33:44 -0400

I automate identifying, downloading, verifying, building and installing
the latest curl release.

It would be nice if the project download page
(https://curl.se/download)  had a mechanism for identifying the latest
release that's easy for automatons to use.  Some projects do this with
softlinks - e.g. /download/latest/curl.tar.{gz,asc}, etc.  Others
maintain a DNS TXT record.  Or a {text,json} file, or..

My script currently asks GitHub rather than use the project page, but
it's a bit involved:

|curl --fail --silent --show-error -L \
     --header 'Accept: application/vnd.github+json' \
https://api.github.com/repos/curl/curl/releases/latest | \
  jq  -r '.assets[].browser_download_url|select(test( "\\.gz(\\.asc)?$"))'|

which (today) results in:

|https://github.com/curl/curl/releases/download/curl-7_86_0/curl-7.86.0.tar.gz||||
https://github.com/curl/curl/releases/download/curl-7_86_0/curl-7.86.0.tar.gz.asc|

||||-- which one then has to fetch with a separate command (or two), and
parse for the version number.

While there's nothing technically wrong with this, it would be simpler
if the project page had softlinks to the latest files.

That would be more friendly for most users than the requirement to
consult GitHub, parse JSON, and  follow the links...

e.g. that sequence would become  something like:

|curl -L --remote-name https://curl.se/download/latest/curl.tar.gz \
         --remote-name
||https://curl.se/download/latest/curl.tar.gz.asc||&& \
FILEPATH="$(tar-tf curl.tar.gz | head -n1)"
|

|I'm not particularly fussy about the actual naming convention;
/download/curl-latest.tar.gz is another obvious choice...|

||||||||||||||--

Timothe Litt
ACM Distinguished Engineer
--------------------------
This communication may not represent the ACM or my employer's views,
if any, on the matters discussed.


-- 
Unsubscribe: https://lists.haxx.se/listinfo/curl-users
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2022-10-26