refactor: use LANG and EDITION in list_supported()

This commit is contained in:
Martin Wimpress 2024-04-28 14:42:19 +01:00 committed by Martin Wimpress
parent a5c2e0dd6b
commit 3ebcc2297f
1 changed files with 10 additions and 13 deletions

View File

@ -364,26 +364,23 @@ function create_config() {
function list_supported() { function list_supported() {
# output OS RELEASE EDITION (usefull for straight testing...) # output OS RELEASE EDITION (usefull for straight testing...)
local DL="" local FUNC=""
local FUNC local OS=""
local OPTION
local OS
for OS in $(os_support); do for OS in $(os_support); do
case ${OS} in FUNC="${OS}"
*ubuntu-server*) FUNC="ubuntu-server";; if [[ "${OS}" == *ubuntu* && "${OS}" != "ubuntu-server" ]]; then
*ubuntu*) FUNC="ubuntu";; FUNC="ubuntu"
*) FUNC="${OS}";; fi
esac
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
# If the OS has an editions_() function, use it. # If the OS has an editions_() function, use it.
if [[ $(type -t "editions_${OS}") == function ]]; then if [[ $(type -t "editions_${OS}") == function ]]; then
for OPTION in $(editions_"${OS}"); do for EDITION in $(editions_"${OS}"); do
echo "${OS} ${RELEASE} ${OPTION}" echo "${OS} ${RELEASE} ${EDITION}"
done done
elif [[ "${OS}" == "windows"* ]]; then elif [[ "${OS}" == "windows"* ]]; then
"languages_${OS}" "languages_${OS}"
for OPTION in "${LANGS[@]}"; do for LANG in "${LANGS[@]}"; do
echo "${OS} ${RELEASE} ${OPTION}" echo "${OS} ${RELEASE} ${LANG}"
done done
else else
echo "${OS} ${RELEASE}" echo "${OS} ${RELEASE}"