cleanup
This commit is contained in:
parent
d08ee1a9d2
commit
dc9049373e
1 changed files with 5 additions and 7 deletions
|
@ -58,14 +58,12 @@ perform file = do
|
||||||
- This can be called before or after the symlink is in place. -}
|
- This can be called before or after the symlink is in place. -}
|
||||||
undo :: FilePath -> Key -> IOException -> Annex a
|
undo :: FilePath -> Key -> IOException -> Annex a
|
||||||
undo file key e = do
|
undo file key e = do
|
||||||
unlessM (inAnnex key) rethrow -- no cleanup to do
|
whenM (inAnnex key) $ do
|
||||||
liftIO $ whenM (doesFileExist file) $ removeFile file
|
liftIO $ whenM (doesFileExist file) $ removeFile file
|
||||||
handle tryharder $ fromAnnex key file
|
handle tryharder $ fromAnnex key file
|
||||||
logStatus key InfoMissing
|
logStatus key InfoMissing
|
||||||
rethrow
|
throw e
|
||||||
where
|
where
|
||||||
rethrow = throw e
|
|
||||||
|
|
||||||
-- fromAnnex could fail if the file ownership is weird
|
-- fromAnnex could fail if the file ownership is weird
|
||||||
tryharder :: IOException -> Annex ()
|
tryharder :: IOException -> Annex ()
|
||||||
tryharder _ = do
|
tryharder _ = do
|
||||||
|
|
Loading…
Reference in a new issue