diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-09 15:23:40 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-09 15:23:40 -0400 |
commit | 97fca09f9b81d3a58e6abfa6e5c30671f6a967b5 (patch) | |
tree | 77674deb0ccd779f18797a5f418557fc2144f63c /Assistant | |
parent | 71aa127011e177bcb434cdc31806386395566a5a (diff) |
fix for Android
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/XMPP/Git.hs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Assistant/XMPP/Git.hs b/Assistant/XMPP/Git.hs index 6a50e13f6..f48178985 100644 --- a/Assistant/XMPP/Git.hs +++ b/Assistant/XMPP/Git.hs @@ -92,8 +92,7 @@ xmppPush cid gitpush handledeferred = runPush SendPack cid handledeferred $ do (readpush, Fd outf) <- liftIO createPipe (Fd controlf, writecontrol) <- liftIO createPipe - tmp <- liftAnnex $ fromRepo gitAnnexTmpDir - let tmpdir = tmp </> "xmppgit" + tmpdir <- gettmpdir installwrapper tmpdir env <- liftIO getEnvironment @@ -160,6 +159,17 @@ xmppPush cid gitpush handledeferred = runPush SendPack cid handledeferred $ do , "exec " ++ program ++ " xmppgit" ] modifyFileMode wrapper $ addModes executeModes + {- Use GIT_ANNEX_TMP_DIR if set, since that may be a better temp + - dir (ie, not on a crippled filesystem where we can't make + - the wrapper executable). -} + gettmpdir = do + v <- liftIO $ getEnv "GIT_ANNEX_TMP_DIR" + case v of + Nothing -> do + tmp <- liftAnnex $ fromRepo gitAnnexTmpDir + return $ tmp </> "xmppgit" + Just d -> return $ d </> "xmppgit" + type EnvVar = String |