2016-05-10 00:21:53 -04:00
|
|
|
# Anaconda comes with binaries of system packages (e.g. `openssl`, `curl`).
|
|
|
|
# Creating shims for those binaries will prevent pyenv users to run those
|
|
|
|
# commands normally when not using Anaconda.
|
|
|
|
#
|
|
|
|
# This hooks is intended to skip creating shims for those executables.
|
|
|
|
|
|
|
|
conda_exists() {
|
|
|
|
shopt -s nullglob
|
|
|
|
local condas=($(echo "${PYENV_ROOT}/versions/"*"/bin/conda" "${PYENV_ROOT}/versions/"*"/envs/"*"/bin/conda"))
|
|
|
|
shopt -u nullglob
|
|
|
|
[ -n "${condas}" ]
|
|
|
|
}
|
|
|
|
|
2016-05-23 21:01:41 -04:00
|
|
|
conda_shim() {
|
|
|
|
case "${1##*/}" in
|
|
|
|
"curl" | "curl-config" )
|
|
|
|
return 0 # curl
|
|
|
|
;;
|
|
|
|
"fc-cache" | "fc-cat" | "fc-list" | "fc-match" | "fc-pattern" | "fc-query" | "fc-scan" | "fc-validate" )
|
|
|
|
return 0 # fontconfig
|
|
|
|
;;
|
|
|
|
"freetype-config" )
|
|
|
|
return 0 # freetype
|
|
|
|
;;
|
|
|
|
"libpng-config" )
|
|
|
|
return 0 # libpng
|
|
|
|
;;
|
|
|
|
"openssl" )
|
|
|
|
return 0 # openssl
|
|
|
|
;;
|
|
|
|
"assistant" | "designer" | "lconvert" | "linguist" | "lrelease" | "lupdate" | "moc" | "pixeltool" | "qcollectiongenerator" | "qdbus" | "qdbuscpp2xml" | "qdbusviewer" | "qdbusxml2cpp" | "qhelpconverter" | "qhelpgenerator" | "qmake" | "qmlplugindump" | "qmlviewer" | "qtconfig" | "rcc" | "uic" | "xmlpatterns" | "xmlpatternsvalidator" )
|
|
|
|
return 0 # qtchooser
|
|
|
|
;;
|
|
|
|
"redis-benchmark" | "redis-check-aof" | "redis-check-dump" | "redis-cli" | "redis-server" )
|
|
|
|
return 0 # redis
|
|
|
|
;;
|
|
|
|
"sqlite3" )
|
|
|
|
return 0 # sqlite3
|
|
|
|
;;
|
|
|
|
"xml2-config" )
|
|
|
|
return 0 # libxml2
|
|
|
|
;;
|
|
|
|
"xslt-config" )
|
|
|
|
return 0 # libxslt
|
|
|
|
;;
|
|
|
|
"xsltproc" )
|
|
|
|
return 0 # xsltproc
|
|
|
|
;;
|
2016-06-08 01:29:04 -04:00
|
|
|
"unxz" | "xz" | "xzcat" | "xzcmd" | "xzdiff" | "xzegrep" | "xzfgrep" | "xzgrep" | "xzless" | "xzmore" )
|
2016-05-23 21:01:41 -04:00
|
|
|
return 0 # xz-utils
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
return 1
|
2016-05-10 00:21:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
deregister_conda_shims() {
|
2016-05-23 21:01:41 -04:00
|
|
|
local shim
|
|
|
|
local shims=()
|
|
|
|
for shim in ${registered_shims}; do
|
|
|
|
if ! conda_shim "${shim}" 1>&2; then
|
|
|
|
shims[${#shims[*]}]="${shim}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
registered_shims="${shims[@]}"
|
2016-05-10 00:21:53 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
if conda_exists; then
|
|
|
|
deregister_conda_shims
|
|
|
|
fi
|