diff options
-rw-r--r-- | Assistant/Install.hs | 37 | ||||
-rw-r--r-- | debian/changelog | 5 | ||||
-rwxr-xr-x | standalone/linux/skel/runshell | 15 | ||||
-rwxr-xr-x | standalone/osx/git-annex.app/Contents/MacOS/runshell | 15 |
4 files changed, 56 insertions, 16 deletions
diff --git a/Assistant/Install.hs b/Assistant/Install.hs index 883ca484c..afbe5b9c0 100644 --- a/Assistant/Install.hs +++ b/Assistant/Install.hs @@ -30,8 +30,8 @@ standaloneAppBase = getEnv "GIT_ANNEX_APP_BASE" {- The standalone app does not have an installation process. - So when it's run, it needs to set up autostarting of the assistant - - daemon, as well as writing the programFile, and putting a - - git-annex-shell wrapper into ~/.ssh + - daemon, as well as writing the programFile, and putting the + - git-annex-shell and git-annex-wrapper wrapper scripts into ~/.ssh - - Note that this is done every time it's started, so if the user moves - it around, the paths this sets up won't break. @@ -59,30 +59,35 @@ ensureInstalled = go =<< standaloneAppBase #endif installAutoStart program autostartfile - {- This shim is only updated if it doesn't - - already exist with the right content. -} sshdir <- sshDir - let shim = sshdir </> "git-annex-shell" - let runshell var = "exec " ++ base </> "runshell" ++ - " git-annex-shell -c \"" ++ var ++ "\"" - let content = unlines + let runshell var = "exec " ++ base </> "runshell " ++ var + let rungitannexshell var = runshell $ "git-annex-shell -c \"" ++ var ++ "\"" + + installWrapper (sshdir </> "git-annex-shell") $ unlines [ shebang_local , "set -e" , "if [ \"x$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then" - , runshell "$SSH_ORIGINAL_COMMAND" + , rungitannexshell "$SSH_ORIGINAL_COMMAND" , "else" - , runshell "$@" + , rungitannexshell "$@" , "fi" ] - - curr <- catchDefaultIO "" $ readFileStrict shim - when (curr /= content) $ do - createDirectoryIfMissing True (parentDir shim) - viaTmp writeFile shim content - modifyFileMode shim $ addModes [ownerExecuteMode] + installWrapper (sshdir </> "git-annex-wrapper") $ unlines + [ shebang_local + , "set -e" + , runshell "\"$@\"" + ] installNautilus program +installWrapper :: FilePath -> String -> IO () +installWrapper file content = do + curr <- catchDefaultIO "" $ readFileStrict file + when (curr /= content) $ do + createDirectoryIfMissing True (parentDir file) + viaTmp writeFile file content + modifyFileMode file $ addModes [ownerExecuteMode] + installNautilus :: FilePath -> IO () #ifdef linux_HOST_OS installNautilus program = do diff --git a/debian/changelog b/debian/changelog index 1650a07ed..0d19407ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -32,6 +32,11 @@ git-annex (5.20140413) UNRELEASED; urgency=medium * webapp: Fix UI for removing XMPP connection. * When init detects that git is not configured to commit, and sets user.email to work around the problem, also make it set user.name. + * webapp: Support using git-annex on a remote server, which was installed + from the standalone tarball or OSX app, and so does not have + git-annex in PATH (and may also not have git or rsync in PATH). + * standalone tarball, OSX app: Install a ~/.ssh/git-annex-wrapper, which + can be used to run git-annex, git, rsync, etc. -- Joey Hess <joeyh@debian.org> Fri, 11 Apr 2014 21:33:35 -0400 diff --git a/standalone/linux/skel/runshell b/standalone/linux/skel/runshell index 4481b0d7f..73703358d 100755 --- a/standalone/linux/skel/runshell +++ b/standalone/linux/skel/runshell @@ -34,11 +34,26 @@ 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 "else" + echo "exec $base/runshell git-annex-shell -c \"\$@\"" + echo "fi" ) > "$HOME/.ssh/git-annex-shell" chmod +x "$HOME/.ssh/git-annex-shell" fi +# And this shim is used by the webapp when adding a remote ssh server. +if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then + mkdir "$HOME/.ssh" >/dev/null 2>&1 || true + ( + echo "#!/bin/sh" + echo "set -e" + echo "exec $base/runshell \"\$@\"" + ) > "$HOME/.ssh/git-annex-wrapper" + chmod +x "$HOME/.ssh/git-annex-wrapper" +fi + # Put our binaries first, to avoid issues with out of date or incompatable # system binaries. ORIG_PATH="$PATH" diff --git a/standalone/osx/git-annex.app/Contents/MacOS/runshell b/standalone/osx/git-annex.app/Contents/MacOS/runshell index 9f1457e25..c5d689c6e 100755 --- a/standalone/osx/git-annex.app/Contents/MacOS/runshell +++ b/standalone/osx/git-annex.app/Contents/MacOS/runshell @@ -36,11 +36,26 @@ 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 "else" + echo "exec $base/runshell git-annex-shell -c \"\$@\"" + echo "fi" ) > "$HOME/.ssh/git-annex-shell" chmod +x "$HOME/.ssh/git-annex-shell" fi +# And this shim is used by the webapp when adding a remote ssh server. +if [ ! -e "$HOME/.ssh/git-annex-wrapper" ]; then + mkdir "$HOME/.ssh" >/dev/null 2>&1 || true + ( + echo "#!/bin/sh" + echo "set -e" + echo "exec $base/runshell \"\$@\"" + ) > "$HOME/.ssh/git-annex-wrapper" + chmod +x "$HOME/.ssh/git-annex-wrapper" +fi + # Put our binaries first, to avoid issues with out of date or incompatable # system binaries. ORIG_PATH="$PATH" |