From 21e3147dbd0f96f07e33b3789a0a0e1e64470d2e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 16 Feb 2016 15:30:59 -0400 Subject: fix numerous problem with test suite on crippled filesystems etc --- Annex/Init.hs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'Annex/Init.hs') diff --git a/Annex/Init.hs b/Annex/Init.hs index 2391549fb..14b39629e 100644 --- a/Annex/Init.hs +++ b/Annex/Init.hs @@ -14,6 +14,7 @@ module Annex.Init ( initialize', uninitialize, probeCrippledFileSystem, + probeCrippledFileSystem', ) where import Annex.Common @@ -134,16 +135,20 @@ isBare = fromRepo Git.repoIsLocalBare - or removing write access from files. -} probeCrippledFileSystem :: Annex Bool probeCrippledFileSystem = do + tmp <- fromRepo gitAnnexTmpMiscDir + createAnnexDirectory tmp + liftIO $ probeCrippledFileSystem' tmp + +probeCrippledFileSystem' :: FilePath -> IO Bool +probeCrippledFileSystem' tmp = do #ifdef mingw32_HOST_OS return True #else - tmp <- fromRepo gitAnnexTmpMiscDir let f = tmp "gaprobe" - createAnnexDirectory tmp - liftIO $ writeFile f "" - uncrippled <- liftIO $ probe f - void $ liftIO $ tryIO $ allowWrite f - liftIO $ removeFile f + writeFile f "" + uncrippled <- probe f + void $ tryIO $ allowWrite f + removeFile f return $ not uncrippled where probe f = catchBoolIO $ do -- cgit v1.2.3