diff options
author | Joey Hess <joey@kitenet.net> | 2012-02-14 03:49:48 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-02-14 03:49:48 -0400 |
commit | cb631ce518b715e36cb3c476d576696f0630738f (patch) | |
tree | f7790f49e3b07eeb0ac86f7fa1b24d06eccbcd2e /Remote.hs | |
parent | 8fbc529d68feb1f40ac7dd44514ac387ba1237ed (diff) |
whereis: Prints the urls of files that the web special remote knows about.
Diffstat (limited to 'Remote.hs')
-rw-r--r-- | Remote.hs | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 |