From: qrczak Date: Mon, 4 Jun 2001 06:20:35 +0000 (+0000) Subject: [project @ 2001-06-04 06:20:35 by qrczak] X-Git-Tag: Approximately_9120_patches~1819 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a14523680bda1c9d78ff5637aad5bac17d2c661d;p=ghc-hetmet.git [project @ 2001-06-04 06:20:35 by qrczak] Don't use exitWith where exceptions are treated as errors. --- diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 310d810..31b0fc3 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.9 2001/04/07 22:30:01 qrczak Exp $ +-- $Id: Main.hs,v 1.10 2001/06/04 06:20:35 qrczak Exp $ -- -- Package management tool ----------------------------------------------------------------------------- @@ -86,7 +86,6 @@ listPackages :: [PackageConfig] -> IO () listPackages details = do hPutStr stdout (listPkgs details) hPutChar stdout '\n' - exitWith ExitSuccess showPackage :: [PackageConfig] -> FilePath -> String -> [PackageConfig->[String]] -> IO () @@ -110,9 +109,8 @@ addPackage details pkgconf = do then die ("package `" ++ name new_pkg ++ "' already installed") else do savePackageConfig pkgconf - maybeRestoreOldConfig pkgconf $ do - writeNewConfig pkgconf (details ++ [new_pkg]) - exitWith ExitSuccess + maybeRestoreOldConfig pkgconf $ + writeNewConfig pkgconf (details ++ [new_pkg]) removePackage :: [PackageConfig] -> FilePath -> String -> IO () removePackage details pkgconf pkg = do @@ -121,9 +119,8 @@ removePackage details pkgconf pkg = do then die ("package `" ++ pkg ++ "' not installed") else do savePackageConfig pkgconf - maybeRestoreOldConfig pkgconf $ do - writeNewConfig pkgconf (filter ((/= pkg) . name) details) - exitWith ExitSuccess + maybeRestoreOldConfig pkgconf $ + writeNewConfig pkgconf (filter ((/= pkg) . name) details) checkConfigAccess :: FilePath -> IO () checkConfigAccess pkgconf = do