Add Downloader field to quickget

This will inform frontend GUIs what download mechanism will be used to get the requested OS.
This commit is contained in:
Martin Wimpress 2021-10-27 16:32:11 +01:00
parent 528064383b
commit 584c855ec3
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3

View File

@ -77,11 +77,12 @@ function list_json() {
function list_csv() {
local DISPLAY_NAME
local DOWNLOADER
local FUNC
local LANG
local OS
local RELEASE
echo "Display Name,OS,Release,Option"
echo "Display Name,OS,Release,Option,Downloader"
for OS in $(os_support); do
DISPLAY_NAME="$(pretty_name "${OS}")"
if [[ "${OS}" == *"ubuntu"* ]]; then
@ -93,16 +94,27 @@ function list_csv() {
fi
for RELEASE in $("releases_${FUNC}"); do
if [ "${OS}" == "macos" ]; then
DOWNLOADER="macrecovery"
elif [ "${OS}" == "ubuntu" ] && [ ${RELEASE} == "canary" ]; then
DOWNLOADER="zsync"
elif [[ "${OS}" == *"ubuntu"* ]] && [ ${RELEASE} == "devel" ]; then
DOWNLOADER="zsync"
else
DOWNLOADER="wget"
fi
if [ "${OS}" == "windows" ]; then
for LANG in "${LANGS[@]}"; do
echo "${DISPLAY_NAME},${OS},${RELEASE},${LANG}"
echo "${DISPLAY_NAME},${OS},${RELEASE},${LANG},${DOWNLOADER}"
done
elif [ "${OS}" == "popos" ]; then
for DRIVER in intel nvidia; do
echo "${DISPLAY_NAME},${OS},${RELEASE},${DRIVER}"
echo "${DISPLAY_NAME},${OS},${RELEASE},${DRIVER},${DOWNLOADER}"
done
else
echo "${DISPLAY_NAME},${OS},${RELEASE},"
echo "${DISPLAY_NAME},${OS},${RELEASE},,${DOWNLOADER}"
fi
done
done