From 1e7714a1af2c6da624f7306363d86e0786b09ab5 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Thu, 23 May 2024 08:14:08 -0400 Subject: [PATCH] refactor(debian): only return the latest releases from each release --- quickget | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/quickget b/quickget index 8fb84dd..177c0df 100755 --- a/quickget +++ b/quickget @@ -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() {