refactor: simplify list_check_all() and list_url_all() initialisation

This commit is contained in:
Martin Wimpress 2024-04-28 10:30:20 +01:00 committed by Martin Wimpress
parent 752afa56f4
commit 4be78cffb5
1 changed files with 6 additions and 15 deletions

View File

@ -394,17 +394,12 @@ function list_supported() {
} }
function list_url_all() { function list_url_all() {
local DIR="/dev/null"
local URL local URL
local FUNC
local OPTION local OPTION
local OS="${1}" local OS="${1}"
if [[ "${OS}" == *ubuntu-server* ]]; then local FUNC="${OS}"
FUNC="ubuntu-server" if [[ "${OS}" == *ubuntu* && "${OS}" != "ubuntu-server" ]]; then
elif [[ "${OS}" == *ubuntu* ]]; then
FUNC="ubuntu" FUNC="ubuntu"
else
FUNC="${OS}"
fi fi
for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases
@ -423,7 +418,7 @@ function list_url_all() {
elif [[ "${OS}" == "macos" ]]; then elif [[ "${OS}" == "macos" ]]; then
validate_release releases_"${OS}" validate_release releases_"${OS}"
echo -e "SKIP:\t${OS}\t${RELEASE}" echo -e "SKIP:\t${OS}\t${RELEASE}"
elif [[ "${OS}" == *ubuntu-server* ]]; then elif [ "${OS}" == "ubuntu-server" ]; then
validate_release releases_ubuntu-server validate_release releases_ubuntu-server
(get_ubuntu-server) (get_ubuntu-server)
elif [[ "${OS}" == *ubuntu* ]]; then elif [[ "${OS}" == *ubuntu* ]]; then
@ -440,15 +435,11 @@ function list_url_all() {
function list_check_all() { function list_check_all() {
local URL local URL
local FUNC
local OPTION local OPTION
local OS="${1}" local OS="${1}"
if [[ "${OS}" == *ubuntu-server* ]]; then local FUNC="${OS}"
FUNC="ubuntu-server" if [[ "${OS}" == *ubuntu* && "${OS}" != "ubuntu-server" ]]; then
elif [[ "${OS}" == *ubuntu* ]]; then
FUNC="ubuntu" FUNC="ubuntu"
else
FUNC="${OS}"
fi fi
for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases for RELEASE in $("releases_${FUNC}" | sed -Ee 's/eol-\S+//g' ); do # hide eol releases
@ -469,7 +460,7 @@ function list_check_all() {
elif [[ "${OS}" == "macos" ]]; then elif [[ "${OS}" == "macos" ]]; then
validate_release releases_"${OS}" validate_release releases_"${OS}"
echo -e "SKIP:\t${OS}\t${RELEASE}" echo -e "SKIP:\t${OS}\t${RELEASE}"
elif [[ "${OS}" == *ubuntu-server* ]]; then elif [ "${OS}" == "ubuntu-server" ]; then
validate_release releases_ubuntu-server validate_release releases_ubuntu-server
(get_ubuntu-server) (get_ubuntu-server)
elif [[ "${OS}" == *ubuntu* ]]; then elif [[ "${OS}" == *ubuntu* ]]; then