Revert "let url claims optionally include a suggested filename"

This reverts commit 85df9c30e9.

Putting filename in the claim was a bad idea.
This commit is contained in:
Joey Hess 2014-12-11 14:09:57 -04:00
parent 30685751ea
commit 7ae16bb6f7
11 changed files with 26 additions and 67 deletions

View file

@ -46,6 +46,7 @@ module Remote (
logStatus,
checkAvailable,
isXMPPRemote,
claimingUrl,
) where
import qualified Data.Map as M
@ -60,6 +61,7 @@ import Annex.UUID
import Logs.UUID
import Logs.Trust
import Logs.Location hiding (logStatus)
import Logs.Web
import Remote.List
import Config
import Git.Types (RemoteName)
@ -318,3 +320,12 @@ hasKey r k = either (Left . show) Right <$> tryNonAsync (checkPresent r k)
hasKeyCheap :: Remote -> Bool
hasKeyCheap = checkPresentCheap
{- The web special remote claims urls by default. -}
claimingUrl :: URLString -> Annex Remote
claimingUrl url = do
rs <- remoteList
let web = Prelude.head $ filter (\r -> uuid r == webUUID) rs
fromMaybe web <$> firstM checkclaim rs
where
checkclaim = maybe (pure False) (flip id url) . claimUrl