From bbd8f2c01e4f3b2f382213840fe62faefdee35a2 Mon Sep 17 00:00:00 2001 From: Lars Fronius Date: Tue, 9 May 2017 12:43:51 +0200 Subject: [PATCH 1/3] Fixes pip-rehash to rehash if pip was called with a flag `pip -v install foobar` or `pip -q install foobar` did not trigger a rehash before. Now it should have the same behaviour as `pip install foobar`. --- pyenv.d/exec/pip-rehash/pip | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pyenv.d/exec/pip-rehash/pip b/pyenv.d/exec/pip-rehash/pip index 8f663726..28590aad 100755 --- a/pyenv.d/exec/pip-rehash/pip +++ b/pyenv.d/exec/pip-rehash/pip @@ -21,9 +21,15 @@ STATUS=0 # Run `pyenv-rehash` after a successful installation. if [ "$STATUS" == "0" ]; then - case "$1" in - "install" | "uninstall" ) pyenv-rehash;; - esac + for piparg in "$@"; do + case ${piparg} in + "install" | "uninstall" ) REHASH=0;; + esac + done +fi + +if [ "$REHASH" == "0" ]; then + pyenv-rehash fi exit "$STATUS" From 95818ab802de18bc990d14ae2eef96d86308ab8f Mon Sep 17 00:00:00 2001 From: Lars Fronius Date: Tue, 9 May 2017 12:50:46 +0200 Subject: [PATCH 2/3] Update pip --- pyenv.d/exec/pip-rehash/pip | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pyenv.d/exec/pip-rehash/pip b/pyenv.d/exec/pip-rehash/pip index 28590aad..db3c2d9e 100755 --- a/pyenv.d/exec/pip-rehash/pip +++ b/pyenv.d/exec/pip-rehash/pip @@ -23,13 +23,9 @@ STATUS=0 if [ "$STATUS" == "0" ]; then for piparg in "$@"; do case ${piparg} in - "install" | "uninstall" ) REHASH=0;; + "install" | "uninstall" ) pyenv-rehash ; break;; esac done fi -if [ "$REHASH" == "0" ]; then - pyenv-rehash -fi - -exit "$STATUS" +exit "$STATUS"; From 1ec90481e854dab4749fa9ca6854a643f03ec6cd Mon Sep 17 00:00:00 2001 From: Lars Fronius Date: Tue, 9 May 2017 12:51:50 +0200 Subject: [PATCH 3/3] Update pip --- pyenv.d/exec/pip-rehash/pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyenv.d/exec/pip-rehash/pip b/pyenv.d/exec/pip-rehash/pip index db3c2d9e..1d305937 100755 --- a/pyenv.d/exec/pip-rehash/pip +++ b/pyenv.d/exec/pip-rehash/pip @@ -28,4 +28,4 @@ if [ "$STATUS" == "0" ]; then done fi -exit "$STATUS"; +exit "$STATUS"