From b651c80fe948fea06f39fa7476da4963e4dfcb4c Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 16 Sep 2008 22:01:52 +0000 Subject: [PATCH] Fix compilation of Setup.hs with GHC 6.9 --- Setup.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 -- 1.7.10.4