Commit 80caca50 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Remove a test for the specific kind of exception for nhc98 compatibility

This was the check for ghc-pkg failing. We cannot check for the
exception being an ExitException since that assumes ghc's
representation of the Exception type, whereas nhc98 defines:
type Exception = IOError
parent 87b444ce
......@@ -99,9 +99,7 @@ import System.FilePath ( (</>), (<.>), takeExtension,
takeDirectory, replaceExtension, splitExtension )
import System.IO (openFile, IOMode(WriteMode), hClose, hPutStrLn)
import Control.Exception as Exception
( Exception(ExitException), catch, handle, try, throwIO )
import System.Exit
( ExitCode(..) )
( catch, handle, try )
-- -----------------------------------------------------------------------------
-- Configuring
......@@ -283,13 +281,11 @@ getInstalledPackages' verbosity packagedbs conf
sequence
[ do str <- rawSystemProgramStdoutConf verbosity ghcPkgProgram conf
["describe", "*", packageDbGhcPkgFlag packagedb]
`Exception.catch` \exception -> case exception of
ExitException (ExitFailure 1) -> die $
`Exception.catch` \_ -> die $
"ghc-pkg describe * failed. If you are using ghc-6.9 "
++ "and have an empty user package database then this "
++ "is probably due to ghc bug #2201. The workaround is to "
++ "register at least one package in the user package db."
_ -> throwIO exception
case parsePackages str of
Left ok -> return (packagedb, ok)
_ -> die "failed to parse output of 'ghc-pkg describe *'"
......
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