fix relaxed with existing file

This commit is contained in:
Joey Hess 2013-03-12 15:58:36 -04:00
parent 1533692cce
commit 70b7555eaf
2 changed files with 16 additions and 10 deletions

View file

@ -60,16 +60,20 @@ perform relaxed url file = ifAnnexed file addurl geturl
liftIO $ createDirectoryIfMissing True (parentDir file) liftIO $ createDirectoryIfMissing True (parentDir file)
ifM (Annex.getState Annex.fast <||> pure relaxed) ifM (Annex.getState Annex.fast <||> pure relaxed)
( nodownload relaxed url file , download url file ) ( nodownload relaxed url file , download url file )
addurl (key, _backend) = do addurl (key, _backend)
headers <- getHttpHeaders | relaxed = do
ifM (liftIO $ Url.check url headers $ keySize key) setUrlPresent key url
( do next $ return True
setUrlPresent key url | otherwise = do
next $ return True headers <- getHttpHeaders
, do ifM (liftIO $ Url.check url headers $ keySize key)
warning $ "failed to verify url: " ++ url ( do
stop setUrlPresent key url
) next $ return True
, do
warning $ "failed to verify url: " ++ url
stop
)
download :: String -> FilePath -> CommandPerform download :: String -> FilePath -> CommandPerform
download url file = do download url file = do

View file

@ -22,3 +22,5 @@ Debian Sid
supported repository versions: 3 4 supported repository versions: 3 4
upgrade supported from repository versions: 0 1 2 upgrade supported from repository versions: 0 1 2
build flags: Assistant Webapp Pairing Testsuite S3 WebDAV Inotify DBus XMPP DNS build flags: Assistant Webapp Pairing Testsuite S3 WebDAV Inotify DBus XMPP DNS
> Missed the case of adding an url to an existing file. [[done]] --[[Joey]]