Commit 27dd76a0 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Move user logging out of registerPackage and into some callers

The main reason is to stop using the pkg and inplace args so that we
can drop them entirely. A side benefit is that we don't actually want
to emit a setupMessage for inplace registering, since that's a rather
uninteresting internal action. We only want it for the explicit
register command. So only one caller gains a call to setupMessage.
parent f1ca9680
......@@ -114,8 +114,9 @@ register pkg@PackageDescription { library = Just lib } lbi regFlags
case () of
_ | modeGenerateRegFile -> writeRegistrationFile installedPkgInfo
| modeGenerateRegScript -> writeRegisterScript installedPkgInfo
| otherwise -> registerPackage verbosity
installedPkgInfo pkg lbi inplace packageDbs
| otherwise -> do
setupMessage verbosity "Registering" (packageId pkg)
registerPackage verbosity installedPkgInfo pkg lbi inplace packageDbs
where
modeGenerateRegFile = isJust (flagToMaybe (regGenPkgConf regFlags))
......@@ -241,11 +242,7 @@ registerPackage :: Verbosity
-> Bool
-> PackageDBStack
-> IO ()
registerPackage verbosity installedPkgInfo pkg lbi inplace packageDbs = do
let msg = if inplace
then "In-place registering"
else "Registering"
setupMessage verbosity msg (packageId pkg)
registerPackage verbosity installedPkgInfo _pkg lbi _inplace packageDbs = do
case compilerFlavor (compiler lbi) of
GHC -> GHC.registerPackage verbosity installedPkgInfo lbi packageDbs
GHCJS -> GHCJS.registerPackage verbosity installedPkgInfo lbi packageDbs
......
Markdown is supported
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