From f2486b21dd64e217bee762a53b71e206fe0892e8 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 5 Jun 2015 16:52:38 -0400 Subject: [PATCH] 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(-) diff --git a/Remote/S3.hs b/Remote/S3.hs index 7b0cf5b23b..8328e86d98 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 [] +