fromkey, registerurl: Allow urls to be specified instead of keys, and generate URL keys.

This is especially useful because the caller doesn't need to generate valid
url keys, which involves some escaping of characters, and may involve
taking a md5sum of the url if it's too long.
This commit is contained in:
Joey Hess 2015-05-22 22:41:36 -04:00
parent 7267af5c50
commit 77c43a388e
9 changed files with 41 additions and 14 deletions

View file

@ -155,7 +155,7 @@ torrentUrlNum u
{- A Key corresponding to the URL of a torrent file. -}
torrentUrlKey :: URLString -> Annex Key
torrentUrlKey u = fromUrl (fst $ torrentUrlNum u) Nothing
torrentUrlKey u = return $ fromUrl (fst $ torrentUrlNum u) Nothing
{- Temporary directory used to download a torrent. -}
tmpTorrentDir :: URLString -> Annex FilePath