diff options
-rw-r--r-- | debian/changelog | 3 | ||||
-rwxr-xr-x | standalone/linux/skel/runshell | 14 | ||||
-rwxr-xr-x | standalone/osx/git-annex.app/Contents/MacOS/runshell | 10 |
3 files changed, 15 insertions, 12 deletions
diff --git a/debian/changelog b/debian/changelog index d856fce27..7e1c0f2a8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,9 @@ git-annex (5.20150523) UNRELEASED; urgency=medium * fromkey, registerurl: Allow urls to be specified instead of keys, and generate URL keys. + * Linux standalone, OSX app: Improve runshell script to always quote + shell vars, so that it will work when eg, untarred into a directory + path with spaces in its name. -- Joey Hess <id@joeyh.name> Fri, 22 May 2015 22:23:32 -0400 diff --git a/standalone/linux/skel/runshell b/standalone/linux/skel/runshell index 6d846104c..b1f36f064 100755 --- a/standalone/linux/skel/runshell +++ b/standalone/linux/skel/runshell @@ -36,9 +36,9 @@ if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then echo "#!/bin/sh" echo "set -e" echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then" - echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\"" + echo "exec '$base/runshell' git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\"" echo "else" - echo "exec $base/runshell git-annex-shell -c \"\$@\"" + echo "exec '$base/runshell' git-annex-shell -c \"\$@\"" echo "fi" ) > "$HOME/.ssh/git-annex-shell" chmod +x "$HOME/.ssh/git-annex-shell" @@ -51,7 +51,7 @@ if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then ( echo "#!/bin/sh" echo "set -e" - echo "exec $base/runshell \"\$@\"" + echo "exec '$base/runshell' \"\$@\"" ) > "$HOME/.ssh/git-annex-wrapper" chmod +x "$HOME/.ssh/git-annex-wrapper" fi @@ -60,11 +60,11 @@ fi # system binaries. ORIG_PATH="$PATH" export ORIG_PATH -PATH=$base/bin:$PATH +PATH="$base/bin:$PATH" export PATH # This is used by the shim wrapper around each binary. -for lib in $(cat $base/libdirs); do +for lib in $(cat "$base/libdirs"); do GIT_ANNEX_LD_LIBRARY_PATH="$base/$lib:$GIT_ANNEX_LD_LIBRARY_PATH" done export GIT_ANNEX_LD_LIBRARY_PATH @@ -73,7 +73,7 @@ export GIT_ANNEX_DIR ORIG_GCONV_PATH="$GCONV_PATH" export ORIG_GCONV_PATH -GCONV_PATH=$base/$(cat $base/gconvdir) +GCONV_PATH="$base/$(cat "$base/gconvdir")" export GCONV_PATH # workaround for https://ghc.haskell.org/trac/ghc/ticket/7695 @@ -82,7 +82,7 @@ export LOCPATH ORIG_GIT_EXEC_PATH="$GIT_EXEC_PATH" export ORIG_GIT_EXEC_PATH -GIT_EXEC_PATH=$base/git-core +GIT_EXEC_PATH="$base/git-core" export GIT_EXEC_PATH ORIG_GIT_TEMPLATE_DIR="$GIT_TEMPLATE_DIR" diff --git a/standalone/osx/git-annex.app/Contents/MacOS/runshell b/standalone/osx/git-annex.app/Contents/MacOS/runshell index 534e9707e..0af0a0c6f 100755 --- a/standalone/osx/git-annex.app/Contents/MacOS/runshell +++ b/standalone/osx/git-annex.app/Contents/MacOS/runshell @@ -38,9 +38,9 @@ if [ ! -e "$HOME/.ssh/git-annex-shell" ]; then echo "#!/bin/sh" echo "set -e" echo "if [ \"x\$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then" - echo "exec $base/runshell git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\"" + echo "exec '$base/runshell' git-annex-shell -c \"\$SSH_ORIGINAL_COMMAND\"" echo "else" - echo "exec $base/runshell git-annex-shell -c \"\$@\"" + echo "exec '$base/runshell' git-annex-shell -c \"\$@\"" echo "fi" ) > "$HOME/.ssh/git-annex-shell" chmod +x "$HOME/.ssh/git-annex-shell" @@ -53,7 +53,7 @@ if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then ( echo "#!/bin/sh" echo "set -e" - echo "exec $base/runshell \"\$@\"" + echo "exec '$base/runshell' \"\$@\"" ) > "$HOME/.ssh/git-annex-wrapper" chmod +x "$HOME/.ssh/git-annex-wrapper" fi @@ -62,12 +62,12 @@ fi # system binaries. ORIG_PATH="$PATH" export ORIG_PATH -PATH=$bundle:$PATH +PATH="$bundle:$PATH" export PATH ORIG_GIT_EXEC_PATH="$GIT_EXEC_PATH" export ORIG_GIT_EXEC_PATH -GIT_EXEC_PATH=$bundle +GIT_EXEC_PATH="$bundle" export GIT_EXEC_PATH ORIG_GIT_TEMPLATE_DIR="$GIT_TEMPLATE_DIR" |