projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix Trac #2433 (deriving Typeable)
[ghc-hetmet.git]
/
compiler
/
main
/
Packages.lhs
diff --git
a/compiler/main/Packages.lhs
b/compiler/main/Packages.lhs
index
b6c320f
..
44ad7d1
100644
(file)
--- a/
compiler/main/Packages.lhs
+++ b/
compiler/main/Packages.lhs
@@
-55,13
+55,13
@@
import Distribution.Text
import Distribution.Version
import FastString
import ErrUtils ( debugTraceMsg, putMsg, Message )
import Distribution.Version
import FastString
import ErrUtils ( debugTraceMsg, putMsg, Message )
+import Exception
import System.Directory
import System.FilePath
import Data.Maybe
import Control.Monad
import Data.List
import System.Directory
import System.FilePath
import Data.Maybe
import Control.Monad
import Data.List
-import Control.Exception ( throwDyn )
-- ---------------------------------------------------------------------------
-- The Package state
-- ---------------------------------------------------------------------------
-- The Package state
@@
-173,7
+173,7
@@
initPackages dflags = do
readPackageConfigs :: DynFlags -> IO PackageConfigMap
readPackageConfigs dflags = do
readPackageConfigs :: DynFlags -> IO PackageConfigMap
readPackageConfigs dflags = do
- e_pkg_path <- try (getEnv "GHC_PACKAGE_PATH")
+ e_pkg_path <- tryIO (getEnv "GHC_PACKAGE_PATH")
system_pkgconfs <- getSystemPackageConfigs dflags
let pkgconfs = case e_pkg_path of
system_pkgconfs <- getSystemPackageConfigs dflags
let pkgconfs = case e_pkg_path of
@@
-216,7
+216,7
@@
getSystemPackageConfigs dflags = do
-- unless the -no-user-package-conf flag was given.
-- We only do this when getAppUserDataDirectory is available
-- (GHC >= 6.3).
-- unless the -no-user-package-conf flag was given.
-- We only do this when getAppUserDataDirectory is available
-- (GHC >= 6.3).
- user_pkgconf <- handle (\_ -> return []) $ do
+ user_pkgconf <- do
appdir <- getAppUserDataDirectory "ghc"
let
pkgconf = appdir
appdir <- getAppUserDataDirectory "ghc"
let
pkgconf = appdir
@@
-226,6
+226,7
@@
getSystemPackageConfigs dflags = do
if (flg && dopt Opt_ReadUserPackageConf dflags)
then return [pkgconf]
else return []
if (flg && dopt Opt_ReadUserPackageConf dflags)
then return [pkgconf]
else return []
+ `catchIO` (\_ -> return [])
return (user_pkgconf ++ system_pkgconfs ++ [system_pkgconf])
return (user_pkgconf ++ system_pkgconfs ++ [system_pkgconf])
@@
-687,7
+688,7
@@
closeDeps pkg_map ps = throwErr (closeDepsErr pkg_map ps)
throwErr :: MaybeErr Message a -> IO a
throwErr m = case m of
throwErr :: MaybeErr Message a -> IO a
throwErr m = case m of
- Failed e -> throwDyn (CmdLineError (showSDoc e))
+ Failed e -> ghcError (CmdLineError (showSDoc e))
Succeeded r -> return r
closeDepsErr :: PackageConfigMap -> [(PackageId,Maybe PackageId)]
Succeeded r -> return r
closeDepsErr :: PackageConfigMap -> [(PackageId,Maybe PackageId)]
@@
-710,7
+711,7
@@
add_package pkg_db ps (p, mb_parent)
return (p : ps')
missingPackageErr :: String -> IO [PackageConfig]
return (p : ps')
missingPackageErr :: String -> IO [PackageConfig]
-missingPackageErr p = throwDyn (CmdLineError (showSDoc (missingPackageMsg p)))
+missingPackageErr p = ghcError (CmdLineError (showSDoc (missingPackageMsg p)))
missingPackageMsg :: String -> SDoc
missingPackageMsg p = ptext (sLit "unknown package:") <+> text p
missingPackageMsg :: String -> SDoc
missingPackageMsg p = ptext (sLit "unknown package:") <+> text p