mirror of
https://github.com/pyenv/pyenv.git
synced 2026-08-03 19:10:34 +09:00
version-name: skip redundant checks (#3492)
This commit is contained in:
parent
958e3aca95
commit
b3a3e702f1
@ -46,20 +46,22 @@ versions=()
|
|||||||
OLDIFS="$IFS"
|
OLDIFS="$IFS"
|
||||||
{ IFS=:
|
{ IFS=:
|
||||||
any_not_installed=0
|
any_not_installed=0
|
||||||
|
normalization_done=
|
||||||
# Unquoted $VAR does glob expansion (against the current dir's contents) after IFS-splitting
|
# Unquoted $VAR does glob expansion (against the current dir's contents) after IFS-splitting
|
||||||
# which is undesired
|
# which is undesired
|
||||||
set -f
|
set -f
|
||||||
for version in ${PYENV_VERSION}; do
|
for version in ${PYENV_VERSION}; do
|
||||||
# Remove the explicit 'python-' prefix from versions like 'python-3.12'.
|
# Remove the explicit 'python-' prefix from versions like 'python-3.12'.
|
||||||
normalised_version="${version#python-}"
|
normalised_version="${version#python-}"
|
||||||
if version_exists "${version}" || [ "$version" = "system" ]; then
|
[[ $version != "${normalised_version}" ]] && normalization_done=1
|
||||||
versions+=("${version}")
|
if [[ $version == "system" ]] || version_exists "${normalised_version}" ; then
|
||||||
elif version_exists "${normalised_version}"; then
|
|
||||||
versions+=("${normalised_version}")
|
versions+=("${normalised_version}")
|
||||||
elif resolved_version="$(pyenv-latest -b "${version}")"; then
|
elif [[ -n $normalization_done ]] && version_exists "${version}"; then
|
||||||
versions+=("${resolved_version}")
|
versions+=("${version}")
|
||||||
elif resolved_version="$(pyenv-latest -b "${normalised_version}")"; then
|
elif resolved_version="$(pyenv-latest -b "${normalised_version}")"; then
|
||||||
versions+=("${resolved_version}")
|
versions+=("${resolved_version}")
|
||||||
|
elif [[ -n $normalization_done ]] && resolved_version="$(pyenv-latest -b "${version}")"; then
|
||||||
|
versions+=("${resolved_version}")
|
||||||
else
|
else
|
||||||
if [[ -n $FORCE ]]; then
|
if [[ -n $FORCE ]]; then
|
||||||
versions+=("${normalised_version}")
|
versions+=("${normalised_version}")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user