@@ -16,9 +16,9 @@ import System.Directory (getTemporaryDirectory
16 , removeFile
16 , removeFile
17 , removeDirectoryRecursive
17 , removeDirectoryRecursive
18 , createDirectoryIfMissing
18 , createDirectoryIfMissing
19− , doesDirectoryExist
19+ , doesFileExist
21−import System.FilePath ((</>), normalise, isAbsolute, dropFileName)
21+import System.FilePath ((</>), normalise)
22import System.IO
22import System.IO
23import System.Info
23import System.Info
24import System.IO.Error
24import System.IO.Error
@@ -76,10 +76,13 @@ withTempdir subdir callback
76 return result
76 return result
78rmFile :: FilePath -> IO ()
78rmFile :: FilePath -> IO ()
80+ fileExists <- doesFileExist f
79−rmFile f = do putStrLn $ "Removing " ++ f
82+ $ do putStrLn $ "Removing " ++ f
80− catchIO (removeFile f)
83+ catchIO (removeFile f)
81− (\ioerr -> putStrLn $ "WARNING: Cannot remove file "
84+ (\ioerr -> putStrLn $ "WARNING: Cannot remove file "
82− ++ f ++ ", Error msg:" ++ show ioerr)
85+ ++ f ++ ", Error msg:" ++ show ioerr)
84setupBundledCC :: IO()
87setupBundledCC :: IO()
85#ifdef FREESTANDING
88#ifdef FREESTANDING