fix(solus): update Solus URLs

The latest Solus release has changed the naming of ISOs:

- Update all related functions to support the ISO name
  format used in the latest release.
- Use the directory listings in order to support more releases in the future.
This commit is contained in:
Silke Hofstra 2024-10-27 20:26:49 +01:00 committed by Martin Wimpress
parent 373f133ac7
commit 652708388e
1 changed files with 8 additions and 3 deletions

View File

@ -1006,12 +1006,12 @@ function releases_slitaz() {
function releases_solus() { function releases_solus() {
#shellcheck disable=SC2046,SC2005 #shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://getsol.us/download/" | grep "isos" | grep Download | cut -d'-' -f 2 | sort -ru) echo $(web_pipe_json "https://downloads.getsol.us/isos/" | jq -r '.[].name[:-1]' | grep -E "^[0-9-]+$" | sort -u)
} }
function editions_solus() { function editions_solus() {
#shellcheck disable=SC2046,SC2005 #shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://getsol.us/download/" | grep "isos" | grep Download | cut -d'.' -f5 | cut -d'-' -f2- | sort -u) echo $(web_pipe_json "https://downloads.getsol.us/isos/$(releases_solus | tail -n1)/" | jq -r '.[].name | sub("Solus-(?<e>.*)-Release-.*"; "\(.e)")' | sort -u)
} }
function releases_sparkylinux() { function releases_sparkylinux() {
@ -1184,6 +1184,11 @@ function web_pipe() {
curl --silent --location "${1}" curl --silent --location "${1}"
} }
# Download a JSON file from the web and pipe it to stdout
function web_pipe_json() {
curl --silent --location --header "Accept: application/json" "${1}"
}
# Download a file from the web # Download a file from the web
function web_get() { function web_get() {
local CHECK="" local CHECK=""
@ -2461,7 +2466,7 @@ function get_slitaz() {
function get_solus() { function get_solus() {
local HASH="" local HASH=""
local ISO="Solus-${RELEASE}-${EDITION}.iso" local ISO="Solus-${EDITION}-Release-${RELEASE}.iso"
local URL="https://downloads.getsol.us/isos/${RELEASE}" local URL="https://downloads.getsol.us/isos/${RELEASE}"
HASH=$(web_pipe "${URL}/${ISO}.sha256sum" | cut -d' ' -f1) HASH=$(web_pipe "${URL}/${ISO}.sha256sum" | cut -d' ' -f1)
echo "${URL}/${ISO} ${HASH}" echo "${URL}/${ISO} ${HASH}"