summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-08-17 11:31:28 +0000
committerIan Lynagh <igloo@earth.li>2008-08-17 11:31:28 +0000
commit9520de572cb08531b67b07569bd30c3ed27d9f94 (patch)
tree6fce4a08ca55b621eef95c01f3bb8a92932180c0
parent39271273d6b1fd2cdfe92be1fa30a7eec3cc9107 (diff)
downloadhaskell-9520de572cb08531b67b07569bd30c3ed27d9f94.tar.gz
Avoid scary "Package contains no library to register" message in installPackage
We only call register if we actually have a library to be registered
-rw-r--r--utils/installPackage/installPackage.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/installPackage/installPackage.hs b/utils/installPackage/installPackage.hs
index 3e86ff0e3d..f36fd233de 100644
--- a/utils/installPackage/installPackage.hs
+++ b/utils/installPackage/installPackage.hs
@@ -1,4 +1,5 @@
+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