summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-07-22 12:57:43 +0000
committerIan Lynagh <igloo@earth.li>2008-07-22 12:57:43 +0000
commit09d76f81a7b77139901a73f9f241d26a5bdd3796 (patch)
tree5431221c2e6a6787e15b31bed8272ae44b8e2ebd /utils
parent85255a966b21172ce5a26c8a9cb0cdaf7315be95 (diff)
downloadhaskell-09d76f81a7b77139901a73f9f241d26a5bdd3796.tar.gz
Fix the stage3 build
Diffstat (limited to 'utils')
-rw-r--r--utils/ghc-pkg/Main.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index bb80e63163..0f0b9ec054 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -635,7 +635,7 @@ doDump = mapM_ putStrLn . intersperse "---" . map showInstalledPackageInfo
findPackages :: PackageDBStack -> PackageArg -> IO [InstalledPackageInfo]
findPackages db_stack pkgarg
= case [ p | p <- all_pkgs, pkgarg `matchesPkg` p ] of
- [] -> die ("cannot find package " ++ pkg_msg pkgarg)
+ [] -> dieWith 2 ("cannot find package " ++ pkg_msg pkgarg)
ps -> return ps
where
all_pkgs = allPackagesInStack db_stack
@@ -1026,11 +1026,14 @@ bye :: String -> IO a
bye s = putStr s >> exitWith ExitSuccess
die :: String -> IO a
-die s = do
+die = dieWith 1
+
+dieWith :: Int -> String -> IO a
+dieWith ec s = do
hFlush stdout
prog <- getProgramName
hPutStrLn stderr (prog ++ ": " ++ s)
- exitWith (ExitFailure 1)
+ exitWith (ExitFailure ec)
dieOrForceAll :: Force -> String -> IO ()
dieOrForceAll ForceAll s = ignoreError s