simpler approach
This commit is contained in:
parent
2bd16f84ae
commit
62ebeb00d9
1 changed files with 5 additions and 7 deletions
12
test.hs
12
test.hs
|
@ -11,7 +11,7 @@ import System.Directory
|
|||
import System.Posix.Directory (changeWorkingDirectory)
|
||||
import System.Posix.Files
|
||||
import IO (bracket_, bracket)
|
||||
import Control.Monad (unless, when)
|
||||
import Control.Monad (unless, when, filterM)
|
||||
import Data.List
|
||||
import System.IO.Error
|
||||
import System.Posix.Env
|
||||
|
@ -537,13 +537,11 @@ cleanup dir = do
|
|||
e <- doesDirectoryExist dir
|
||||
when e $ do
|
||||
-- git-annex prevents annexed file content from being
|
||||
-- removed via permissions bits; undo
|
||||
recurseDir SystemFS dir >>= mapM_ fixmodes
|
||||
-- removed via directory permissions; undo
|
||||
recurseDir SystemFS dir >>=
|
||||
filterM doesDirectoryExist >>=
|
||||
mapM_ Content.allowWrite
|
||||
removeDirectoryRecursive dir
|
||||
where
|
||||
fixmodes f = do
|
||||
s <- getSymbolicLinkStatus f
|
||||
unless (isSymbolicLink s) $ Content.allowWrite f
|
||||
|
||||
checklink :: FilePath -> Assertion
|
||||
checklink f = do
|
||||
|
|
Loading…
Reference in a new issue