summaryrefslogtreecommitdiff
path: root/Remote/S3.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-06-05 16:52:38 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-06-05 16:52:38 -0400
commit90c4dbad8ed5777d7f893834a253cdf126d62eda (patch)
tree921ca161c044ada905ecb32a4c6582d3d2fedaa4 /Remote/S3.hs
parentfd34881509f25cf7d0fc711246e2369f56787e42 (diff)
show S3 urls for public repos in whereis
Note that it's possible for a S3 bucket to be configured to allow public access, but for git-annex to not know that it is. I chose to not show the url unless public=yes.
Diffstat (limited to 'Remote/S3.hs')
-rw-r--r--Remote/S3.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/Remote/S3.hs b/Remote/S3.hs
index 7b0cf5b23..8328e86d9 100644
--- a/Remote/S3.hs
+++ b/Remote/S3.hs
@@ -82,7 +82,7 @@ gen r u c gc = do
, removeKey = removeKeyDummy
, checkPresent = checkPresentDummy
, checkPresentCheap = False
- , whereisKey = Nothing
+ , whereisKey = Just (getWebUrls info)
, remoteFsck = Nothing
, repairRepo = Nothing
, config = c
@@ -593,3 +593,9 @@ s3Info c info = catMaybes
]
where
s3c = s3Configuration c
+
+getWebUrls :: S3Info -> Key -> Annex [URLString]
+getWebUrls info k = case (public info, getpublicurl info) of
+ (True, Just geturl) -> return [geturl k]
+ _ -> return []
+