summaryrefslogtreecommitdiff
path: root/ui-macos/git-annex.app/Contents/MacOS/runshell
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-25 11:58:36 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-25 11:58:36 -0400
commite2d7cb16af74dc7fc18d8e7e5f6e950e08dbae3e (patch)
treedb85346caa0ab771455eb6573d2670d054205de0 /ui-macos/git-annex.app/Contents/MacOS/runshell
parent9074f5b5553702fdf79836bd12e768613fef0175 (diff)
switch to DYLD_FALLBACK_LIBRARY_PATH
Diffstat (limited to 'ui-macos/git-annex.app/Contents/MacOS/runshell')
-rwxr-xr-xui-macos/git-annex.app/Contents/MacOS/runshell15
1 files changed, 11 insertions, 4 deletions
diff --git a/ui-macos/git-annex.app/Contents/MacOS/runshell b/ui-macos/git-annex.app/Contents/MacOS/runshell
index 82a75c401..40ae01bdb 100755
--- a/ui-macos/git-annex.app/Contents/MacOS/runshell
+++ b/ui-macos/git-annex.app/Contents/MacOS/runshell
@@ -1,4 +1,7 @@
#!/bin/sh
+# Runs a shell command (or interactive shell) using the binaries and
+# libraries bundled with this app.
+
set -e
base="$(dirname $0)"
@@ -23,16 +26,20 @@ cd "$base"
base="$(pwd)"
cd "$orig"
-# Put our binaries first, so our overloaded libs don't get used with
+# Put our binaries first, to avoid issues with out of date or incompatable
# system binaries.
-# Also avoids issues with out of date system binaries.
PATH=$base/bin:$PATH
export PATH
+# Using DYLD_FALLBACK_LIBRARY_PATH rather than DYLD_LIBRARY_PATH, so as
+# not to force binaries to link against possibly the wrong versions of
+# libraries found in the path. With DYLD_FALLBACK_LIBRARY_PATH, the
+# system's versions of libraries will be used when possible, and otherwise
+# it will fall back to using the libraries bundled with this app.
for lib in "$(cat libdirs)"; do
- DYLD_LIBRARY_PATH="$base/$lib:$DYLD_LIBRARY_PATH"
+ DYLD_FALLBACK_LIBRARY_PATH="$base/$lib:$DYLD_FALLBACK_LIBRARY_PATH"
done
-export DYLD_LIBRARY_PATH
+export DYLD_FALLBACK_LIBRARY_PATH
GIT_EXEC_PATH=$base/git-core
export GIT_EXEC_PATH