fix use of wrong shebang when android is installing git-annex-shell wrapper on server
This commit is contained in:
parent
2a7d573280
commit
749c197947
5 changed files with 15 additions and 9 deletions
|
@ -63,7 +63,7 @@ ensureInstalled = go =<< standaloneAppBase
|
||||||
let runshell var = "exec " ++ base </> "runshell" ++
|
let runshell var = "exec " ++ base </> "runshell" ++
|
||||||
" git-annex-shell -c \"" ++ var ++ "\""
|
" git-annex-shell -c \"" ++ var ++ "\""
|
||||||
let content = unlines
|
let content = unlines
|
||||||
[ shebang
|
[ shebang_local
|
||||||
, "set -e"
|
, "set -e"
|
||||||
, "if [ \"x$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
, "if [ \"x$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
||||||
, runshell "$SSH_ORIGINAL_COMMAND"
|
, runshell "$SSH_ORIGINAL_COMMAND"
|
||||||
|
|
|
@ -125,7 +125,7 @@ addAuthorizedKeysCommand rsynconly dir pubkey = intercalate "&&"
|
||||||
echoval v = "echo " ++ shellEscape v
|
echoval v = "echo " ++ shellEscape v
|
||||||
wrapper = "~/.ssh/git-annex-shell"
|
wrapper = "~/.ssh/git-annex-shell"
|
||||||
script =
|
script =
|
||||||
[ shebang
|
[ shebang_portable
|
||||||
, "set -e"
|
, "set -e"
|
||||||
, "if [ \"x$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
, "if [ \"x$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then"
|
||||||
, runshell "$SSH_ORIGINAL_COMMAND"
|
, runshell "$SSH_ORIGINAL_COMMAND"
|
||||||
|
|
|
@ -156,7 +156,7 @@ xmppPush cid gitpush handledeferred = runPush SendPack cid handledeferred $ do
|
||||||
let wrapper = tmpdir </> "git-remote-xmpp"
|
let wrapper = tmpdir </> "git-remote-xmpp"
|
||||||
program <- readProgramFile
|
program <- readProgramFile
|
||||||
writeFile wrapper $ unlines
|
writeFile wrapper $ unlines
|
||||||
[ shebang
|
[ shebang_local
|
||||||
, "exec " ++ program ++ " xmppgit"
|
, "exec " ++ program ++ " xmppgit"
|
||||||
]
|
]
|
||||||
modifyFileMode wrapper $ addModes executeModes
|
modifyFileMode wrapper $ addModes executeModes
|
||||||
|
|
2
Init.hs
2
Init.hs
|
@ -106,7 +106,7 @@ preCommitHook = (</>) <$> fromRepo Git.localGitDir <*> pure "hooks/pre-commit"
|
||||||
|
|
||||||
preCommitScript :: String
|
preCommitScript :: String
|
||||||
preCommitScript = unlines
|
preCommitScript = unlines
|
||||||
[ shebang
|
[ shebang_local
|
||||||
, "# automatically configured by git-annex"
|
, "# automatically configured by git-annex"
|
||||||
, "git annex pre-commit ."
|
, "git annex pre-commit ."
|
||||||
]
|
]
|
||||||
|
|
|
@ -9,12 +9,18 @@
|
||||||
|
|
||||||
module Utility.Shell where
|
module Utility.Shell where
|
||||||
|
|
||||||
shellPath :: FilePath
|
shellPath_portable :: FilePath
|
||||||
|
shellPath_portable = "/bin/sh"
|
||||||
|
|
||||||
|
shellPath_local :: FilePath
|
||||||
#ifndef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
shellPath = "/bin/sh"
|
shellPath_local = shellPath_portable
|
||||||
#else
|
#else
|
||||||
shellPath = "/system/bin/sh"
|
shellPath_local = "/system/bin/sh"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
shebang :: String
|
shebang_portable :: String
|
||||||
shebang = "#!" ++ shellPath
|
shebang_portable = "#!" ++ shellPath_portable
|
||||||
|
|
||||||
|
shebang_local :: String
|
||||||
|
shebang_local = "#!" ++ shellPath_local
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue