fix(fedora): handle the space in the beta release (#1492)
* fix(fedora): handle the space in the beta release fixes #1462 adjust the RELEASE to remove and replace the space * fix(fedora): only list available editions where a release is selected fixes #1493
This commit is contained in:
parent
17a5971e49
commit
16a43af329
26
quickget
26
quickget
|
@ -211,7 +211,13 @@ function handle_missing() {
|
|||
# Handle odd missing Fedora combinations
|
||||
case "${OS}" in
|
||||
fedora)
|
||||
if [[ "${RELEASE}" -lt 40 && "${EDITION}" == "Onyx" ]] || [[ "${RELEASE}" -lt 40 && "${EDITION}" == "Sericea" ]]; then
|
||||
# First we need to handle the Beta naming kludge
|
||||
if [[ "${RELEASE}" == *"_Beta" ]]; then
|
||||
NRELEASE="${RELEASE/_Beta/}"
|
||||
else
|
||||
NRELEASE="${RELEASE}"
|
||||
fi
|
||||
if [[ "${NRELEASE}" -lt 40 && "${EDITION}" == "Onyx" ]] || [[ "${NRELEASE}" -lt 40 && "${EDITION}" == "Sericea" ]]; then
|
||||
echo "ERROR! Unsupported combination"
|
||||
echo " Fedora ${RELEASE} ${EDITION} is not available, please choose another Release or Edition"
|
||||
exit 1
|
||||
|
@ -699,12 +705,16 @@ function editions_endless() {
|
|||
|
||||
function releases_fedora() {
|
||||
#shellcheck disable=SC2046,SC2005
|
||||
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r 'map(.version) | unique | .[]' | sort -r)
|
||||
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r 'map(.version) | unique | .[]' | sed 's/ /_/g' | sort -r)
|
||||
}
|
||||
|
||||
function editions_fedora() {
|
||||
#shellcheck disable=SC2046,SC2005
|
||||
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r 'map(select(.arch=="x86_64" 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 | .[]')
|
||||
if [[ -z ${RELEASE} ]]; then
|
||||
echo $(web_pipe "https://getfedora.org/releases.json" | jq -r "map(select(.arch==\"x86_64\" 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==\"x86_64\" 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 releases_freebsd() {
|
||||
|
@ -1802,6 +1812,16 @@ function get_fedora() {
|
|||
Server|Kinoite|Onyx|Silverblue|Sericea|Workstation) VARIANT="${EDITION}";;
|
||||
*) VARIANT="Spins";;
|
||||
esac
|
||||
# The naming of 41 Beta with a space is problematic so we replaced it with an underscore
|
||||
# but we need to convert it back to a space for the URL search in the JSON
|
||||
#shellcheck disable=SC2086
|
||||
# if RELEASE contains an underscore, replace it with a space
|
||||
if [[ "${RELEASE}" == *"_"* ]]; then
|
||||
RELEASE="${RELEASE/_/ }"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
JSON=$(web_pipe "https://getfedora.org/releases.json" | jq '.[] | select(.variant=="'${VARIANT}'" and .subvariant=="'"${EDITION}"'" and .arch=="x86_64" and .version=="'"${RELEASE}"'" and .sha256 != null)')
|
||||
URL=$(echo "${JSON}" | jq -r '.link' | head -n1)
|
||||
|
|
Loading…
Reference in New Issue