Commit 9520de57 authored by Ian Lynagh's avatar Ian Lynagh

Avoid scary "Package contains no library to register" message in installPackage

We only call register if we actually have a library to be registered
parent 39271273
import Control.Monad
import Data.Maybe
import Distribution.PackageDescription
import Distribution.PackageDescription.Parse
......@@ -124,7 +125,11 @@ doInstall verbosity distPref enableShellWrappers strip
lbi_reg = lbi { installDirTemplates = i_reg,
withPrograms = progs' }
(copyHook simpleUserHooks) pd lbi_copy userHooks copyFlags
(regHook simpleUserHooks) pd_reg lbi_reg userHooks registerFlags
-- Cabal prints a scary "Package contains no library to register"
-- message if we call register but this is an executable package.
-- We therefore don't call it if we don't have a library for it.
when (isJust (library pd_reg)) $
(regHook simpleUserHooks) pd_reg lbi_reg userHooks registerFlags
return ()
replaceTopdir :: FilePath -> FilePath -> FilePath
......
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