mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Fix rehash test to give up sooner after lock file's presence
This commit is contained in:
parent
b1e3f13a85
commit
7973e59473
2 changed files with 7 additions and 5 deletions
|
@ -34,6 +34,11 @@ release_lock() {
|
|||
remove_prototype_shim
|
||||
}
|
||||
|
||||
if [ ! -w "$SHIM_PATH" ]; then
|
||||
echo "pyenv: cannot rehash: $SHIM_PATH isn't writable"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
unset acquired
|
||||
for _ in $(seq "${PYENV_REHASH_TIMEOUT:-60}"); do
|
||||
if acquire_lock 2>/dev/null; then
|
||||
|
@ -46,11 +51,7 @@ for _ in $(seq "${PYENV_REHASH_TIMEOUT:-60}"); do
|
|||
done
|
||||
|
||||
if [ -z "${acquired}" ]; then
|
||||
if [ -w "$SHIM_PATH" ]; then
|
||||
echo "pyenv: cannot rehash: $PROTOTYPE_SHIM_PATH exists"
|
||||
else
|
||||
echo "pyenv: cannot rehash: $SHIM_PATH isn't writable"
|
||||
fi
|
||||
echo "pyenv: cannot rehash: $PROTOTYPE_SHIM_PATH exists"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ create_executable() {
|
|||
}
|
||||
|
||||
@test "rehash in progress" {
|
||||
export PYENV_REHASH_TIMEOUT=1
|
||||
mkdir -p "${PYENV_ROOT}/shims"
|
||||
touch "${PYENV_ROOT}/shims/.pyenv-shim"
|
||||
run pyenv-rehash
|
||||
|
|
Loading…
Reference in a new issue