Commit 7eb960f9 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Fix the GHC HEAD build: Don't use deprecated catch function

We could make this conditional, to support old GHC versions, but I
don't think it is worth the cost to support 6.8. By the time this Cabal
is released, you will need at least 6.12 (if not higher) to build the
GHC it comes with.
parent b24eca13
......@@ -72,10 +72,13 @@ generate pkg_descr lbi =
" ) where\n"++
"import Prelude (catch, IO, FilePath, return, (++))\n"++
"import qualified Control.Exception as Exception\n"++
"import Data.Version (Version(..))\n"++
"import System.Environment (getEnv)"++
"catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a\n"++
"catchIO = Exception.catch\n" ++
"\nversion :: Version"++
"\nversion = " ++ show (packageVersion pkg_descr)
......@@ -140,7 +143,7 @@ generate pkg_descr lbi =
mkGetDir _ (Just dirrel) = "getPrefixDirRel " ++ show dirrel
mkGetDir dir Nothing = "return " ++ show dir
mkGetEnvOr var expr = "catch (getEnv \""++var'++"\")"++
mkGetEnvOr var expr = "catchIO (getEnv \""++var'++"\")"++
" (\\_ -> "++expr++")"
where var' = pkgPathEnvVar pkg_descr var
Supports Markdown
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