FIX BUILD: maybeUpdateFile: ignore failures when removing the target
authorSimon Marlow <simonmar@microsoft.com>
Fri, 23 Nov 2007 09:22:19 +0000 (09:22 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Fri, 23 Nov 2007 09:22:19 +0000 (09:22 +0000)
Setup.hs

index e8f73b6..9575aa0 100644 (file)
--- a/Setup.hs
+++ b/Setup.hs
@@ -15,6 +15,7 @@ import System.Cmd
 import System.FilePath
 import System.Exit
 import System.Directory
+import Control.Exception (try)
 
 main :: IO ()
 main = do let hooks = defaultUserHooks {
@@ -59,7 +60,7 @@ maybeUpdateFile source target = do
   r <- rawSystem "cmp" ["-s" {-quiet-}, source, target]
   case r of 
     ExitSuccess   -> removeFile source
-    ExitFailure _ -> do removeFile target; renameFile source target
+    ExitFailure _ -> do try (removeFile target); renameFile source target
   
 
 filter_modules_hook :: Hook a -> Hook a