fix reversion on repo deletion

A broken symlink would cause the mode setting to fail.
This commit is contained in:
Joey Hess 2014-02-03 14:20:39 -04:00
parent ec417b108d
commit c91bbc9494
2 changed files with 3 additions and 2 deletions

View file

@ -99,7 +99,8 @@ deleteCurrentRepository = dangerPage $ do
{- Make all directories writable and files writable
- so all annexed content can be deleted. -}
liftIO $ do
recurseDir SystemFS dir >>= mapM_ allowWrite
recurseDir SystemFS dir
>>= mapM_ (void . tryIO . allowWrite)
removeDirectoryRecursive dir
redirect ShutdownConfirmedR

View file

@ -1178,7 +1178,7 @@ cleanup' final dir = whenM (doesDirectoryExist dir) $ do
-- they can be deleted. Both git and git-annex use file
-- permissions to prevent deletion.
recurseDir SystemFS dir >>=
mapM_ Utility.FileMode.allowWrite
mapM_ (void . tryIO . Utility.FileMode.allowWrite)
-- This sometimes fails on Windows, due to some files
-- being still opened by a subprocess.
catchIO (removeDirectoryRecursive dir) $ \e -> do