summaryrefslogtreecommitdiff
path: root/Remote.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-14 03:49:48 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-14 03:49:48 -0400
commitcb631ce518b715e36cb3c476d576696f0630738f (patch)
treef7790f49e3b07eeb0ac86f7fa1b24d06eccbcd2e /Remote.hs
parent8fbc529d68feb1f40ac7dd44514ac387ba1237ed (diff)
whereis: Prints the urls of files that the web special remote knows about.
Diffstat (limited to 'Remote.hs')
-rw-r--r--Remote.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Remote.hs b/Remote.hs
index ffb53446b..861319e08 100644
--- a/Remote.hs
+++ b/Remote.hs
@@ -15,6 +15,7 @@ module Remote (
removeKey,
hasKey,
hasKeyCheap,
+ whereisKey,
remoteTypes,
remoteList,
@@ -48,16 +49,16 @@ import Logs.Trust
import Logs.Location
import Remote.List
-{- Map of UUIDs of Remotes and their names. -}
-remoteMap :: Annex (M.Map UUID String)
-remoteMap = M.fromList . map (\r -> (uuid r, name r)) .
+{- Map from UUIDs of Remotes to a calculated value. -}
+remoteMap :: (Remote -> a) -> Annex (M.Map UUID a)
+remoteMap c = M.fromList . map (\r -> (uuid r, c r)) .
filter (\r -> uuid r /= NoUUID) <$> remoteList
{- Map of UUIDs and their descriptions.
- The names of Remotes are added to suppliment any description that has
- been set for a repository. -}
uuidDescriptions :: Annex (M.Map UUID String)
-uuidDescriptions = M.unionWith addName <$> uuidMap <*> remoteMap
+uuidDescriptions = M.unionWith addName <$> uuidMap <*> remoteMap name
addName :: String -> String -> String
addName desc n