From: Ian Lynagh Date: Tue, 16 Sep 2008 22:01:52 +0000 (+0000) Subject: Fix compilation of Setup.hs with GHC 6.9 X-Git-Tag: 6_10_branch_has_been_forked^0 X-Git-Url: http://git.megacz.com/?p=ghc-prim.git;a=commitdiff_plain;h=b651c80fe948fea06f39fa7476da4963e4dfcb4c Fix compilation of Setup.hs with GHC 6.9 --- diff --git a/Setup.hs b/Setup.hs index ebd4ce7..5e736ab 100644 --- a/Setup.hs +++ b/Setup.hs @@ -16,7 +16,6 @@ import System.Cmd import System.FilePath import System.Exit import System.Directory -import Control.Exception (try) main :: IO () main = do let hooks = simpleUserHooks { @@ -85,5 +84,7 @@ maybeUpdateFile source target = do r <- rawSystem "cmp" ["-s" {-quiet-}, source, target] case r of ExitSuccess -> removeFile source - ExitFailure _ -> do try (removeFile target); renameFile source target + ExitFailure _ -> do exists <- doesFileExist target + when exists $ removeFile target + renameFile source target