Urls can now be claimed by remotes. This will allow creating, for example, a external special remote that handles magnet: and *.torrent urls.
This commit is contained in:
parent
ee27298b91
commit
30bf112185
28 changed files with 346 additions and 114 deletions
|
@ -10,6 +10,7 @@ module Command.RmUrl where
|
|||
import Common.Annex
|
||||
import Command
|
||||
import Logs.Web
|
||||
import qualified Remote
|
||||
|
||||
cmd :: [Command]
|
||||
cmd = [notBareRepo $
|
||||
|
@ -26,5 +27,9 @@ start (file, url) = flip whenAnnexed file $ \_ key -> do
|
|||
|
||||
cleanup :: String -> Key -> CommandCleanup
|
||||
cleanup url key = do
|
||||
setUrlMissing key url
|
||||
r <- Remote.claimingUrl url
|
||||
let url' = if Remote.uuid r == webUUID
|
||||
then url
|
||||
else setDownloader url OtherDownloader
|
||||
setUrlMissing (Remote.uuid r) key url'
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue