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.
This commit is contained in:
Joey Hess 2015-06-05 16:52:38 -04:00
parent c2cdc9a7cf
commit f2486b21dd

View file

@ -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 []