From 62ebeb00d9f079f079c38798f8496dd666ae1fd5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 9 Feb 2011 01:01:06 -0400 Subject: simpler approach --- test.hs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/test.hs b/test.hs index b68360e9d..b32a4abb0 100644 --- a/test.hs +++ b/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 -- cgit v1.2.3