Fix compilation with GHC 6.2.x
authorSimon Marlow <simonmar@microsoft.com>
Wed, 21 Nov 2007 08:43:41 +0000 (08:43 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 21 Nov 2007 08:43:41 +0000 (08:43 +0000)
Setup.hs

index 40033bd..e8f73b6 100644 (file)
--- a/Setup.hs
+++ b/Setup.hs
@@ -58,9 +58,9 @@ maybeUpdateFile :: FilePath -> FilePath -> IO ()
 maybeUpdateFile source target = do
   r <- rawSystem "cmp" ["-s" {-quiet-}, source, target]
   case r of 
-    ExitSuccess   -> return ()
-    ExitFailure _ -> copyFile source target
-  removeFile source
+    ExitSuccess   -> removeFile source
+    ExitFailure _ -> do removeFile target; renameFile source target
+  
 
 filter_modules_hook :: Hook a -> Hook a
 filter_modules_hook f pd lbi uhs x