summaryrefslogtreecommitdiff
path: root/Remote/Bup.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-22 13:48:50 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-22 14:30:43 -0400
commit4ec9244f1af85b95d014103d93de913026b20fe3 (patch)
treec2ca5dbdc4817f1078b76cd445a4fa69531e905c /Remote/Bup.hs
parente4592649d68535ad45fe37449a90427e84734359 (diff)
add a path field to remotes
Also broke out some helper functions around constructing remotes, to be used later.
Diffstat (limited to 'Remote/Bup.hs')
-rw-r--r--Remote/Bup.hs33
1 files changed, 18 insertions, 15 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs
index 8a2c1afef..83739a3e1 100644
--- a/Remote/Bup.hs
+++ b/Remote/Bup.hs
@@ -46,21 +46,24 @@ gen r u c = do
return $ encryptableRemote c
(storeEncrypted r buprepo)
(retrieveEncrypted buprepo)
- Remote {
- uuid = u',
- cost = cst,
- name = Git.repoDescribe r,
- storeKey = store r buprepo,
- retrieveKeyFile = retrieve buprepo,
- retrieveKeyFileCheap = retrieveCheap buprepo,
- removeKey = remove,
- hasKey = checkPresent r bupr',
- hasKeyCheap = bupLocal buprepo,
- whereisKey = Nothing,
- config = c,
- repo = r,
- remotetype = remote
- }
+ Remote
+ { uuid = u'
+ , cost = cst
+ , name = Git.repoDescribe r
+ , storeKey = store r buprepo
+ , retrieveKeyFile = retrieve buprepo
+ , retrieveKeyFileCheap = retrieveCheap buprepo
+ , removeKey = remove
+ , hasKey = checkPresent r bupr'
+ , hasKeyCheap = bupLocal buprepo
+ , whereisKey = Nothing
+ , config = c
+ , repo = r
+ , path = if bupLocal buprepo && not (null buprepo)
+ then Just buprepo
+ else Nothing
+ , remotetype = remote
+ }
bupSetup :: UUID -> RemoteConfig -> Annex RemoteConfig
bupSetup u c = do