2021-02-25 00:55:13 -05:00
|
|
|
DEFINITION_PREFIX="${DEFINITION%%:*}"
|
|
|
|
DEFINITION_TYPE="${DEFINITION_PREFIX%%-*}" # TODO: support non-CPython versions
|
|
|
|
if [[ "${DEFINITION}" != "${DEFINITION_PREFIX}" ]]; then
|
2022-09-05 18:43:12 -04:00
|
|
|
DEFINITION_CANDIDATES=(\
|
|
|
|
$(python-build --definitions | \
|
2022-09-05 16:20:39 -04:00
|
|
|
grep -F "${DEFINITION_PREFIX}" | \
|
|
|
|
grep "^${DEFINITION_TYPE}" | \
|
|
|
|
sed -E -e '/-dev$/d' -e '/-src$/d' -e '/(b|rc)[0-9]+$/d' | \
|
|
|
|
sort -t. -k1,1r -k 2,2nr -k 3,3nr \
|
|
|
|
|| true))
|
2021-02-25 00:55:13 -05:00
|
|
|
DEFINITION="${DEFINITION_CANDIDATES}"
|
|
|
|
VERSION_NAME="${DEFINITION##*/}"
|
|
|
|
fi
|