also verify new urls when adding them to existing files
This commit is contained in:
parent
17fed709c8
commit
a3ebf16e62
1 changed files with 3 additions and 0 deletions
|
@ -19,6 +19,7 @@ import qualified Utility.Url as Url
|
||||||
import Annex.Content
|
import Annex.Content
|
||||||
import Logs.Web
|
import Logs.Web
|
||||||
import qualified Option
|
import qualified Option
|
||||||
|
import Types.Key
|
||||||
|
|
||||||
def :: [Command]
|
def :: [Command]
|
||||||
def = [withOptions [fileOption] $
|
def = [withOptions [fileOption] $
|
||||||
|
@ -50,6 +51,8 @@ perform url file = ifAnnexed file addurl geturl
|
||||||
fast <- Annex.getState Annex.fast
|
fast <- Annex.getState Annex.fast
|
||||||
if fast then nodownload url file else download url file
|
if fast then nodownload url file else download url file
|
||||||
addurl (key, _backend) = do
|
addurl (key, _backend) = do
|
||||||
|
unlessM (liftIO $ Url.check url (keySize key)) $
|
||||||
|
error $ "failed to verify url: " ++ url
|
||||||
setUrlPresent key url
|
setUrlPresent key url
|
||||||
next $ return True
|
next $ return True
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue