From 83e5459cfb591adf3798ab9d8fed25a5c8081b05 Mon Sep 17 00:00:00 2001 From: Casey McGinty Date: Mon, 30 Apr 2018 21:56:09 -0700 Subject: [PATCH] Remove shebang lines from scripts for performance All scripts in libexec/ (excluding pyenv) are called through pyenv, therefore the shebang lines are not necessary. On some systems this provides a measurable increase in performance of the shell prompt. Related to pyenv/pyenv-virtualenv#259 --- libexec/pyenv---version | 1 - libexec/pyenv-commands | 1 - libexec/pyenv-completions | 1 - libexec/pyenv-exec | 2 -- libexec/pyenv-global | 2 -- libexec/pyenv-help | 2 -- libexec/pyenv-hooks | 1 - libexec/pyenv-init | 1 - libexec/pyenv-local | 2 -- libexec/pyenv-prefix | 1 - libexec/pyenv-rehash | 2 -- libexec/pyenv-root | 1 - libexec/pyenv-sh-rehash | 1 - libexec/pyenv-sh-shell | 2 -- libexec/pyenv-shims | 1 - libexec/pyenv-version | 1 - libexec/pyenv-version-file | 1 - libexec/pyenv-version-file-read | 1 - libexec/pyenv-version-file-write | 1 - libexec/pyenv-version-name | 1 - libexec/pyenv-version-origin | 1 - libexec/pyenv-versions | 1 - libexec/pyenv-whence | 1 - libexec/pyenv-which | 2 -- plugins/python-build/bin/pyenv-install | 2 -- plugins/python-build/bin/pyenv-uninstall | 2 -- plugins/python-build/test/stubs/stub | 1 - pyenv.d/exec/pip-rehash/conda | 2 -- pyenv.d/exec/pip-rehash/easy_install | 2 -- pyenv.d/exec/pip-rehash/pip | 2 -- test/init.bats | 2 +- test/libexec/pyenv-echo | 1 - 32 files changed, 1 insertion(+), 44 deletions(-) diff --git a/libexec/pyenv---version b/libexec/pyenv---version index 8745c23e..b64ac124 100755 --- a/libexec/pyenv---version +++ b/libexec/pyenv---version @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: Display the version of pyenv # # Displays the version number of this pyenv release, including the diff --git a/libexec/pyenv-commands b/libexec/pyenv-commands index 283ce44b..147d3d8a 100755 --- a/libexec/pyenv-commands +++ b/libexec/pyenv-commands @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: List all available pyenv commands # Usage: pyenv commands [--sh|--no-sh] diff --git a/libexec/pyenv-completions b/libexec/pyenv-completions index 227b932e..8ebf26b1 100755 --- a/libexec/pyenv-completions +++ b/libexec/pyenv-completions @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Usage: pyenv completions [arg1 arg2...] set -e diff --git a/libexec/pyenv-exec b/libexec/pyenv-exec index 51c668e3..18829ad0 100755 --- a/libexec/pyenv-exec +++ b/libexec/pyenv-exec @@ -1,5 +1,3 @@ -#!/usr/bin/env bash -# # Summary: Run an executable with the selected Python version # # Usage: pyenv exec [arg1 arg2...] diff --git a/libexec/pyenv-global b/libexec/pyenv-global index 102e082a..0905b446 100755 --- a/libexec/pyenv-global +++ b/libexec/pyenv-global @@ -1,5 +1,3 @@ -#!/usr/bin/env bash -# # Summary: Set or show the global Python version # # Usage: pyenv global diff --git a/libexec/pyenv-help b/libexec/pyenv-help index 8270993e..7fd4320b 100755 --- a/libexec/pyenv-help +++ b/libexec/pyenv-help @@ -1,5 +1,3 @@ -#!/usr/bin/env bash -# # Summary: Display help for a command # # Usage: pyenv help [--usage] COMMAND diff --git a/libexec/pyenv-hooks b/libexec/pyenv-hooks index 2c1620f3..7a465b76 100755 --- a/libexec/pyenv-hooks +++ b/libexec/pyenv-hooks @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: List hook scripts for a given pyenv command # Usage: pyenv hooks diff --git a/libexec/pyenv-init b/libexec/pyenv-init index 659d1f4c..5ec7b234 100755 --- a/libexec/pyenv-init +++ b/libexec/pyenv-init @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: Configure the shell environment for pyenv # Usage: eval "$(pyenv init - [--no-rehash] [])" diff --git a/libexec/pyenv-local b/libexec/pyenv-local index 8a2a6747..c1812a64 100755 --- a/libexec/pyenv-local +++ b/libexec/pyenv-local @@ -1,5 +1,3 @@ -#!/usr/bin/env bash -# # Summary: Set or show the local application-specific Python version # # Usage: pyenv local diff --git a/libexec/pyenv-prefix b/libexec/pyenv-prefix index ac04f6bc..a836acca 100755 --- a/libexec/pyenv-prefix +++ b/libexec/pyenv-prefix @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: Display prefix for a Python version # Usage: pyenv prefix [] # diff --git a/libexec/pyenv-rehash b/libexec/pyenv-rehash index 5c421c41..6e44e932 100755 --- a/libexec/pyenv-rehash +++ b/libexec/pyenv-rehash @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: Rehash pyenv shims (run this after installing executables) set -e @@ -62,7 +61,6 @@ fi # serves as a locking mechanism. create_prototype_shim() { cat > "$PROTOTYPE_SHIM_PATH" <... diff --git a/libexec/pyenv-shims b/libexec/pyenv-shims index 43c6308a..35b9670b 100755 --- a/libexec/pyenv-shims +++ b/libexec/pyenv-shims @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: List existing pyenv shims # Usage: pyenv shims [--short] diff --git a/libexec/pyenv-version b/libexec/pyenv-version index dd5fa29a..b4260f4d 100755 --- a/libexec/pyenv-version +++ b/libexec/pyenv-version @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: Show the current Python version and its origin # # Shows the currently selected Python version and how it was diff --git a/libexec/pyenv-version-file b/libexec/pyenv-version-file index 91d8b0d3..aa855af7 100755 --- a/libexec/pyenv-version-file +++ b/libexec/pyenv-version-file @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Usage: pyenv version-file [] # Summary: Detect the file that sets the current pyenv version set -e diff --git a/libexec/pyenv-version-file-read b/libexec/pyenv-version-file-read index 7d27d5a5..f48f5efb 100755 --- a/libexec/pyenv-version-file-read +++ b/libexec/pyenv-version-file-read @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Usage: pyenv version-file-read set -e [ -n "$PYENV_DEBUG" ] && set -x diff --git a/libexec/pyenv-version-file-write b/libexec/pyenv-version-file-write index 7095140f..7b635cff 100755 --- a/libexec/pyenv-version-file-write +++ b/libexec/pyenv-version-file-write @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Usage: pyenv version-file-write set -e diff --git a/libexec/pyenv-version-name b/libexec/pyenv-version-name index 65a198a4..0af63a26 100755 --- a/libexec/pyenv-version-name +++ b/libexec/pyenv-version-name @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: Show the current Python version set -e [ -n "$PYENV_DEBUG" ] && set -x diff --git a/libexec/pyenv-version-origin b/libexec/pyenv-version-origin index 1067a013..c5b0905b 100755 --- a/libexec/pyenv-version-origin +++ b/libexec/pyenv-version-origin @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: Explain how the current Python version is set set -e [ -n "$PYENV_DEBUG" ] && set -x diff --git a/libexec/pyenv-versions b/libexec/pyenv-versions index 019c0e90..9462b124 100755 --- a/libexec/pyenv-versions +++ b/libexec/pyenv-versions @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: List all Python versions available to pyenv # Usage: pyenv versions [--bare] [--skip-aliases] # diff --git a/libexec/pyenv-whence b/libexec/pyenv-whence index fddcf112..8ca1b2e8 100755 --- a/libexec/pyenv-whence +++ b/libexec/pyenv-whence @@ -1,4 +1,3 @@ -#!/usr/bin/env bash # Summary: List all Python versions that contain the given executable # Usage: pyenv whence [--path] diff --git a/libexec/pyenv-which b/libexec/pyenv-which index 9551f6cf..02171332 100755 --- a/libexec/pyenv-which +++ b/libexec/pyenv-which @@ -1,5 +1,3 @@ -#!/usr/bin/env bash -# # Summary: Display the full path to an executable # # Usage: pyenv which diff --git a/plugins/python-build/bin/pyenv-install b/plugins/python-build/bin/pyenv-install index 22333f6e..01d6cd2f 100755 --- a/plugins/python-build/bin/pyenv-install +++ b/plugins/python-build/bin/pyenv-install @@ -1,5 +1,3 @@ -#!/usr/bin/env bash -# # Summary: Install a Python version using python-build # # Usage: pyenv install [-f] [-kvp] diff --git a/plugins/python-build/bin/pyenv-uninstall b/plugins/python-build/bin/pyenv-uninstall index 91805454..662da776 100755 --- a/plugins/python-build/bin/pyenv-uninstall +++ b/plugins/python-build/bin/pyenv-uninstall @@ -1,5 +1,3 @@ -#!/usr/bin/env bash -# # Summary: Uninstall a specific Python version # # Usage: pyenv uninstall [-f|--force] diff --git a/plugins/python-build/test/stubs/stub b/plugins/python-build/test/stubs/stub index bd5c5d68..7494ef73 100755 --- a/plugins/python-build/test/stubs/stub +++ b/plugins/python-build/test/stubs/stub @@ -1,4 +1,3 @@ -#!/usr/bin/env bash set -e status=0 diff --git a/pyenv.d/exec/pip-rehash/conda b/pyenv.d/exec/pip-rehash/conda index ee5aefe8..4398198a 100755 --- a/pyenv.d/exec/pip-rehash/conda +++ b/pyenv.d/exec/pip-rehash/conda @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - set -e [ -n "$PYENV_DEBUG" ] && set -x diff --git a/pyenv.d/exec/pip-rehash/easy_install b/pyenv.d/exec/pip-rehash/easy_install index cf559dcb..de0dcfc3 100755 --- a/pyenv.d/exec/pip-rehash/easy_install +++ b/pyenv.d/exec/pip-rehash/easy_install @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - set -e [ -n "$PYENV_DEBUG" ] && set -x diff --git a/pyenv.d/exec/pip-rehash/pip b/pyenv.d/exec/pip-rehash/pip index 1d305937..542a6436 100755 --- a/pyenv.d/exec/pip-rehash/pip +++ b/pyenv.d/exec/pip-rehash/pip @@ -1,5 +1,3 @@ -#!/usr/bin/env bash - set -e [ -n "$PYENV_DEBUG" ] && set -x diff --git a/test/init.bats b/test/init.bats index ead63d82..004f47d7 100755 --- a/test/init.bats +++ b/test/init.bats @@ -35,7 +35,7 @@ load test_helper cd "$PYENV_TEST_DIR" cat > myscript.sh <] VAR if [[ $1 == -F* ]]; then