support bup repositories on removable media
This commit is contained in:
parent
f808a83350
commit
54286c993d
1 changed files with 16 additions and 3 deletions
|
@ -159,10 +159,23 @@ storeBupUUID u buprepo = do
|
||||||
Git.run r' "config" [Param "annex.uuid", Param u]
|
Git.run r' "config" [Param "annex.uuid", Param u]
|
||||||
|
|
||||||
{- Allow for bup repositories on removable media by checking
|
{- Allow for bup repositories on removable media by checking
|
||||||
- local bup repositories -}
|
- local bup repositories to see if they are available, and getting their
|
||||||
|
- uuid (which may be different from the stored uuid for the bup remote).
|
||||||
|
-
|
||||||
|
- If a bup repository is not available, returns a dummy uuid of "".
|
||||||
|
- This will cause checkPresent to indicate nothing from the bup remote
|
||||||
|
- is known to be present.
|
||||||
|
-}
|
||||||
getBupUUID :: FilePath -> UUID -> Annex UUID
|
getBupUUID :: FilePath -> UUID -> Annex UUID
|
||||||
getBupUUID buprepo u = do
|
getBupUUID buprepo u = liftIO $ do
|
||||||
return u -- TODO
|
r <- bup2GitRemote buprepo
|
||||||
|
if Git.repoIsUrl r
|
||||||
|
then return u
|
||||||
|
else do
|
||||||
|
ret <- try $ Git.configRead r
|
||||||
|
case ret of
|
||||||
|
Right r' -> return $ Git.configGet r' "annex.uuid" ""
|
||||||
|
Left _ -> return ""
|
||||||
|
|
||||||
{- Converts a bup remote path spec into a Git.Repo. There are some
|
{- Converts a bup remote path spec into a Git.Repo. There are some
|
||||||
- differences in path representation between git and bup. -}
|
- differences in path representation between git and bup. -}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue