summaryrefslogtreecommitdiff
path: root/Remote/Bup.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/Bup.hs')
-rw-r--r--Remote/Bup.hs19
1 files changed, 16 insertions, 3 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs
index fdc3919e2..dc653631d 100644
--- a/Remote/Bup.hs
+++ b/Remote/Bup.hs
@@ -159,10 +159,23 @@ storeBupUUID u buprepo = do
Git.run r' "config" [Param "annex.uuid", Param u]
{- 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 buprepo u = do
- return u -- TODO
+getBupUUID buprepo u = liftIO $ do
+ 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
- differences in path representation between git and bup. -}