From 3ebcc2297fc6aa25b57f9ff4c0f7c0a6a4b2d142 Mon Sep 17 00:00:00 2001 From: Martin Wimpress Date: Sun, 28 Apr 2024 14:42:19 +0100 Subject: [PATCH] refactor: use LANG and EDITION in list_supported() --- quickget | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/quickget b/quickget index f6781c0..6aab28c 100755 --- a/quickget +++ b/quickget @@ -364,26 +364,23 @@ function create_config() { function list_supported() { # output OS RELEASE EDITION (usefull for straight testing...) - local DL="" - local FUNC - local OPTION - local OS + local FUNC="" + local OS="" for OS in $(os_support); do - case ${OS} in - *ubuntu-server*) FUNC="ubuntu-server";; - *ubuntu*) FUNC="ubuntu";; - *) FUNC="${OS}";; - esac + FUNC="${OS}" + if [[ "${OS}" == *ubuntu* && "${OS}" != "ubuntu-server" ]]; then + FUNC="ubuntu" + fi for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases # If the OS has an editions_() function, use it. if [[ $(type -t "editions_${OS}") == function ]]; then - for OPTION in $(editions_"${OS}"); do - echo "${OS} ${RELEASE} ${OPTION}" + for EDITION in $(editions_"${OS}"); do + echo "${OS} ${RELEASE} ${EDITION}" done elif [[ "${OS}" == "windows"* ]]; then "languages_${OS}" - for OPTION in "${LANGS[@]}"; do - echo "${OS} ${RELEASE} ${OPTION}" + for LANG in "${LANGS[@]}"; do + echo "${OS} ${RELEASE} ${LANG}" done else echo "${OS} ${RELEASE}"