From: Simon Marlow Date: Fri, 23 Nov 2007 09:22:19 +0000 (+0000) Subject: FIX BUILD: maybeUpdateFile: ignore failures when removing the target X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=fa7614b6882d774d91f3ffa17dbab13b120bcad2;p=ghc-base.git FIX BUILD: maybeUpdateFile: ignore failures when removing the target --- diff --git a/Setup.hs b/Setup.hs index e8f73b6..9575aa0 100644 --- 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