rethought --relaxed change
Better to make it not be surprising and slow, than surprising and fast. --raw can be used when it needs to be really fast. Implemented adding a youtube-dl supported url to an existing file. This commit was sponsored by andrea rota.
This commit is contained in:
parent
8a0038ec23
commit
2528e3ddb0
7 changed files with 75 additions and 84 deletions
|
@ -1017,10 +1017,10 @@ pruneTmpWorkDirBefore f action = do
|
|||
{- Runs an action, passing it a temporary work directory where
|
||||
- it can write files while receiving the content of a key.
|
||||
-
|
||||
- On exception, or when the action returns a Left value,
|
||||
- On exception, or when the action returns Nothing,
|
||||
- the temporary work directory is left, so resumes can use it.
|
||||
-}
|
||||
withTmpWorkDir :: Key -> (FilePath -> Annex (Either a b)) -> Annex (Either a b)
|
||||
withTmpWorkDir :: Key -> (FilePath -> Annex (Maybe a)) -> Annex (Maybe a)
|
||||
withTmpWorkDir key action = do
|
||||
-- Create the object file if it does not exist. This way,
|
||||
-- staleKeysPrune only has to look for object files, and can
|
||||
|
@ -1034,8 +1034,8 @@ withTmpWorkDir key action = do
|
|||
setAnnexDirPerm tmpdir
|
||||
res <- action tmpdir
|
||||
case res of
|
||||
Right _ -> liftIO $ removeDirectoryRecursive tmpdir
|
||||
Left _ -> noop
|
||||
Just _ -> liftIO $ removeDirectoryRecursive tmpdir
|
||||
Nothing -> noop
|
||||
return res
|
||||
|
||||
{- Finds items in the first, smaller list, that are not
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue