DistroHopper/templates/fedora
2026-05-27 17:00:06 +02:00

55 lines
2.2 KiB
Text

# Template file for 'fedora'
OSNAME="fedora"
PRETTY="Fedora"
LOGO=" "
ICON="fedora.svg"
ICON_ONLINE="https://distrowatch.com/images/yvzhuwbpy/fedora.png"
CATEGORY="Beginner"
BASEDOF="-"
HOMEPAGE="https://www.fedoraproject.org"
DESCRIPTION="Innovative platform for hardware, clouds, and containers, built with love by you"
CREDENTIALS="-"
GPG=""
RSS=""
DW=""
function releases_() {
#shellcheck disable=SC2046,SC2005
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r 'map(.version) | unique | .[]' | sed 's/ /_/g' | sort -r)
}
function editions_() {
local QEMU_ARCH
QEMU_ARCH=$(_qarch_to_upstream "${ARCH:-amd64}")
#shellcheck disable=SC2046,SC2005
if [[ -z ${RELEASE} ]]; then
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r "map(select(.arch==\"${QEMU_ARCH}\" and .variant!=\"Labs\" and .variant!=\"IoT\" and .variant!=\"Container\" and .variant!=\"Cloud\" and .variant!=\"Everything\" and .subvariant!=\"Security\" and .subvariant!=\"Server_KVM\" and .subvariant!=\"SoaS\")) | map(.subvariant) | unique | .[]")
else
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r "map(select(.arch==\"${QEMU_ARCH}\" and .version==\"${RELEASE/_/ }\" and .variant!=\"Labs\" and .variant!=\"IoT\" and .variant!=\"Container\" and .variant!=\"Cloud\" and .variant!=\"Everything\" and .subvariant!=\"Security\" and .subvariant!=\"Server_KVM\" and .subvariant!=\"SoaS\")) | map(.subvariant) | unique | .[]")
fi
}
function arch_() {
echo amd64 arm64 ppc64el s390x
}
function get_() {
local HASH=""
local ISO=""
local JSON=""
local URL=""
local VARIANT=""
local QEMU_ARCH
QEMU_ARCH=$(_qarch_to_upstream "${ARCH:-amd64}")
case ${EDITION} in
Server|Kinoite|Onyx|Silverblue|Sericea|Workstation) VARIANT="${EDITION}";;
*) VARIANT="Spins";;
esac
if [[ "${RELEASE}" == *"_"* ]]; then
RELEASE="${RELEASE/_/ }"
fi
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select(.variant=="'${VARIANT}'" and .subvariant=="'"${EDITION}"'" and .arch=="'"${QEMU_ARCH}"'" and .version=="'"${RELEASE}"'" and (.link | endswith(".iso")))')
URL=$(echo "${JSON}" | jq -r '.link' | head -n1)
HASH=$(echo "${JSON}" | jq -r '.sha256' | head -n1)
echo "${URL} ${HASH}"
}