Skip creating shims for conda's system executables, more reliably (#594, #595)

This commit is contained in:
Yamashita, Yuu 2016-05-24 01:01:41 +00:00
parent 0a73b8f886
commit 1921dbef18

View file

@ -11,111 +11,57 @@ conda_exists() {
[ -n "${condas}" ] [ -n "${condas}" ]
} }
conda_shims() { conda_shim() {
## curl case "${1##*/}" in
cat <<EOS "curl" | "curl-config" )
curl return 0 # curl
curl-config ;;
EOS "fc-cache" | "fc-cat" | "fc-list" | "fc-match" | "fc-pattern" | "fc-query" | "fc-scan" | "fc-validate" )
return 0 # fontconfig
## fontconfig ;;
cat <<EOS "freetype-config" )
fc-cache return 0 # freetype
fc-cat ;;
fc-list "libpng-config" )
fc-match return 0 # libpng
fc-pattern ;;
fc-query "openssl" )
fc-scan return 0 # openssl
fc-validate ;;
EOS "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
## freetype ;;
cat <<EOS "redis-benchmark" | "redis-check-aof" | "redis-check-dump" | "redis-cli" | "redis-server" )
freetype-config return 0 # redis
EOS ;;
"sqlite3" )
## libpng return 0 # sqlite3
cat <<EOS ;;
libpng-config "xml2-config" )
EOS return 0 # libxml2
;;
## openssl "xslt-config" )
cat <<EOS return 0 # libxslt
openssl ;;
EOS "xsltproc" )
return 0 # xsltproc
## qtchooser ;;
cat <<EOS "xz" )
assistant return 0 # xz-utils
designer ;;
lconvert esac
linguist return 1
lrelease
lupdate
moc
pixeltool
qcollectiongenerator
qdbus
qdbuscpp2xml
qdbusviewer
qdbusxml2cpp
qhelpconverter
qhelpgenerator
qmake
qmlplugindump
qmlviewer
qtconfig
rcc
uic
xmlpatterns
xmlpatternsvalidator
EOS
## redis
cat <<EOS
redis-benchmark
redis-check-aof
redis-check-dump
redis-cli
redis-server
EOS
## sqlite3
cat <<EOS
sqlite3
EOS
## libxml2
cat <<EOS
xml2-config
EOS
## libxslt
cat <<EOS
xslt-config
EOS
## xsltproc
cat <<EOS
xsltproc
EOS
# xz-utils
cat <<EOS
xz
EOS
}
# Remove conda shims
filter_conda_shims() {
{ cat
conda_shims
} | sort | uniq -c | awk '$1=="1"{print $2}' | tr '\n' ' '
} }
deregister_conda_shims() { deregister_conda_shims() {
registered_shims="$(for shim in $registered_shims; do echo "${shim}"; done | filter_conda_shims)" 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[@]}"
} }
if conda_exists; then if conda_exists; then