refactor(debian): only return the latest releases from each release

This commit is contained in:
Martin Wimpress 2024-05-23 08:14:08 -04:00 committed by Martin Wimpress
parent 5e96af3eca
commit 1e7714a1af
1 changed files with 11 additions and 3 deletions

View File

@ -697,12 +697,20 @@ function releases_crunchbang++() {
}
function releases_debian() {
local ARCHIVE=""
local MAJ=""
local NEW=""
local OLD=""
NEW=$(web_pipe "https://cdimage.debian.org/debian-cd/" | grep '\.[0-9]/' | cut -d'>' -f 9 | cut -d'/' -f 1)
OLD=$(web_pipe "https://cdimage.debian.org/cdimage/archive/" | grep -e '>[1-9][0-9]\.' | grep -v 'live' | grep -v NEVER | cut -d'>' -f 9 | cut -d'/' -f 1 | tac | head -20)
#shellcheck disable=SC2086
echo ${NEW} ${OLD}
echo -n "${NEW}"
MAJ=$(echo "${NEW}" | cut -d'.' -f 1)
ARCHIVE="$(web_pipe "https://cdimage.debian.org/cdimage/archive/" | grep folder | grep -v NEVER | cut -d'"' -f 6)"
for i in {1..2}; do
CUR=$((MAJ - i))
OLD=$(grep ^"${CUR}" <<< "${ARCHIVE}" | tail -n 1 | tr -d '/')
echo -n " ${OLD}"
done
echo
}
function editions_debian() {