Add /usr/etc/pyenv.d to hooks path (#3039)

The directory /usr/etc is an optional directory and used by
Fedora, RHEL 9, and openSUSE. The purpose of /usr/etc is to store
distribution-provided configuration files that can be overridden
by user-modified files in /etc.

/usr/etc is not in FHS. However, as Torsten stated in his comment
(https://github.com/thkukuk/atomic-updates_and_etc/issues/2#issuecomment-524848666)
"[FHS] is currently nearly as dead as LSB, we can only ignore it
if we don't want to stop and kill all innovation."
This commit is contained in:
Tom Schraitle 2024-08-24 11:38:54 +02:00 committed by GitHub
parent 9ecd803bff
commit 57a6772451
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -94,7 +94,7 @@ if [ "${bin_path%/*}" != "$PYENV_ROOT" ]; then
# Add pyenv's own `pyenv.d` unless pyenv was cloned to PYENV_ROOT # Add pyenv's own `pyenv.d` unless pyenv was cloned to PYENV_ROOT
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${bin_path%/*}/pyenv.d" PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${bin_path%/*}/pyenv.d"
fi fi
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks" PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:/usr/etc/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks"
for plugin_hook in "${PYENV_ROOT}/plugins/"*/etc/pyenv.d; do for plugin_hook in "${PYENV_ROOT}/plugins/"*/etc/pyenv.d; do
PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${plugin_hook}" PYENV_HOOK_PATH="${PYENV_HOOK_PATH}:${plugin_hook}"
done done

View file

@ -68,5 +68,5 @@ load test_helper
@test "PYENV_HOOK_PATH includes pyenv built-in plugins" { @test "PYENV_HOOK_PATH includes pyenv built-in plugins" {
unset PYENV_HOOK_PATH unset PYENV_HOOK_PATH
run pyenv echo "PYENV_HOOK_PATH" run pyenv echo "PYENV_HOOK_PATH"
assert_success "${PYENV_ROOT}/pyenv.d:${BATS_TEST_DIRNAME%/*}/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks" assert_success "${PYENV_ROOT}/pyenv.d:${BATS_TEST_DIRNAME%/*}/pyenv.d:/usr/etc/pyenv.d:/usr/local/etc/pyenv.d:/etc/pyenv.d:/usr/lib/pyenv/hooks"
} }