Commit a35d80b5 authored by ijones's avatar ijones
Browse files

patches from John Goerzen for GHC5 compatibility.

parent fd193b2a
{-# OPTIONS -cpp #-}
module Compat.RawSystem (rawSystem) where
#ifndef __GLASGOW_HASKELL__
#if (!(defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ > 600))
import Data.List (intersperse)
import System.Cmd (system)
import System.Exit (ExitCode)
......@@ -10,7 +10,7 @@ import System.Cmd (rawSystem)
#endif
#ifndef __GLASGOW_HASKELL__
#if (!(defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ > 600))
rawSystem :: String -> [String] -> IO ExitCode
rawSystem p args = system $ concat $ intersperse " " (p : map esc args)
where esc arg = "\"" ++ arg ++ "\"" -- this is hideously broken, actually
......
......@@ -76,11 +76,10 @@ import Distribution.Version (Version(..), VersionRange(..),
import System.Environment(getArgs)
import System.Directory(removeFile)
import System.IO.Error(try)
import Control.Monad(when)
import Data.Maybe(isNothing)
import Data.List ( intersperse )
import System.IO (hPutStr, stderr)
import System.IO (hPutStr, stderr, try)
#ifdef DEBUG
import HUnit (Test)
......
......@@ -413,7 +413,7 @@ copyFileTimes src dest
copyFile :: FilePath -> FilePath -> IO ()
copyFile src dest
| dest == src = fail "copyFile: source and destination are the same file"
#ifndef __GLASGOW_HASKELL__
#if (!(defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ > 600))
| otherwise = do readFile src >>= writeFile dest
try (copyPermissions src dest)
return ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment