From 6112062fdd57d84330def5e6f8a5e1634a019fd0 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Johnsen Date: Sat, 28 Dec 2024 12:41:09 +0100 Subject: [PATCH] fix: add automatic rehash after pip3.x/pip3.xx install The tests showed that the original implementation actually never worked. You did NOT get a rehash after doing pip3.8 install, even when the comments in the code said so. --> replaced `\d` with [0-9] and slapped on a `+`, such that we match both pip3.x and `pip3.xx install` --- pyenv.d/exec/pip-rehash.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyenv.d/exec/pip-rehash.bash b/pyenv.d/exec/pip-rehash.bash index f3687566..a90317fa 100644 --- a/pyenv.d/exec/pip-rehash.bash +++ b/pyenv.d/exec/pip-rehash.bash @@ -2,7 +2,7 @@ PYENV_PIP_REHASH_ROOT="${BASH_SOURCE[0]%/*}/pip-rehash" PYENV_REHASH_COMMAND="${PYENV_COMMAND##*/}" # Remove any version information, from e.g. "pip2" or "pip3.4". -if [[ $PYENV_REHASH_COMMAND =~ ^(pip|easy_install)[23](\.\d)?$ ]]; then +if [[ $PYENV_REHASH_COMMAND =~ ^(pip|easy_install)[23](\.[0-9]+)?$ ]]; then PYENV_REHASH_COMMAND="${BASH_REMATCH[1]}" fi