From 90c4dbad8ed5777d7f893834a253cdf126d62eda Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 5 Jun 2015 16:52:38 -0400 Subject: 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. --- Remote/S3.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Remote') 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 [] + -- cgit v1.2.3