Revert "Avoid creating ~/.bup when initializing a bup remote"
This reverts commit 6da40100c9
.
On closer examinaton, this change is wrong. The bup special remote
can be configured with "buprepo=", which makes it use the default
~/.bup repo. This change makes it use a different temp dir each time,
which I'm sure would not be appreciated by anyone with that
configuration.
Bup insisting in creating ~/.bup even when using a different repo
does seem like a bug in *something*, but I'm leaning toward the bug
being in bup itself.
This commit is contained in:
parent
141718da73
commit
303666965a
1 changed files with 1 additions and 14 deletions
|
@ -11,8 +11,6 @@ import qualified Data.ByteString.Lazy.Char8 as L
|
||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import System.Process
|
import System.Process
|
||||||
import System.Posix.Env (getEnvironment)
|
|
||||||
import System.Path (brackettmpdir)
|
|
||||||
|
|
||||||
import Common.Annex
|
import Common.Annex
|
||||||
import Types.Remote
|
import Types.Remote
|
||||||
|
@ -85,21 +83,10 @@ bupParams :: String -> BupRepo -> [CommandParam] -> [CommandParam]
|
||||||
bupParams command buprepo params =
|
bupParams command buprepo params =
|
||||||
Param command : [Param "-r", Param buprepo] ++ params
|
Param command : [Param "-r", Param buprepo] ++ params
|
||||||
|
|
||||||
isLocal :: BupRepo -> Bool
|
|
||||||
isLocal buprepo = not (elem ':' buprepo)
|
|
||||||
|
|
||||||
bup :: String -> BupRepo -> [CommandParam] -> Annex Bool
|
bup :: String -> BupRepo -> [CommandParam] -> Annex Bool
|
||||||
bup command buprepo params = do
|
bup command buprepo params = do
|
||||||
showOutput -- make way for bup output
|
showOutput -- make way for bup output
|
||||||
liftIO action
|
liftIO $ boolSystem "bup" $ bupParams command buprepo params
|
||||||
where
|
|
||||||
action | isLocal buprepo = runBup lparams buprepo
|
|
||||||
| otherwise = brackettmpdir "bupXXXXXX" $ runBup rparams
|
|
||||||
lparams = Param command : params
|
|
||||||
rparams = bupParams command buprepo params
|
|
||||||
runBup params bupdir = do
|
|
||||||
env <- getEnvironment
|
|
||||||
boolSystemEnv "bup" params (Just (("BUP_DIR", bupdir) : env))
|
|
||||||
|
|
||||||
pipeBup :: [CommandParam] -> Maybe Handle -> Maybe Handle -> IO Bool
|
pipeBup :: [CommandParam] -> Maybe Handle -> Maybe Handle -> IO Bool
|
||||||
pipeBup params inh outh = do
|
pipeBup params inh outh = do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue