refactor: use LANG and EDITION in list_supported()

This commit is contained in:
Martin Wimpress 2024-04-28 14:42:19 +01:00
parent 7c8db64c1b
commit ed855c05a7
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3

View File

@ -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}"