summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/main/Finder.lhs26
1 files changed, 18 insertions, 8 deletions
diff --git a/compiler/main/Finder.lhs b/compiler/main/Finder.lhs
index 4c6ae29298..500e36e807 100644
--- a/compiler/main/Finder.lhs
+++ b/compiler/main/Finder.lhs
@@ -570,14 +570,8 @@ cantFindErr cannot_find dflags mod_name find_result
NotFound files mb_pkg
| null files
-> ptext (sLit "it is not a module in the current program, or in any known package.")
- | Just pkg <- mb_pkg, pkg /= thisPackage dflags, build_tag /= ""
- -> let
- build = if build_tag == "p" then "profiling"
- else "\"" ++ build_tag ++ "\""
- in
- ptext (sLit "Perhaps you haven't installed the ") <> text build <>
- ptext (sLit " libraries for package ") <> ppr pkg <> char '?' $$
- not_found files
+ | Just pkg <- mb_pkg, pkg /= thisPackage dflags
+ -> not_found_in_package pkg files
| otherwise
-> not_found files
@@ -589,6 +583,22 @@ cantFindErr cannot_find dflags mod_name find_result
build_tag = buildTag dflags
+ not_found_in_package pkg files
+ | build_tag /= ""
+ = let
+ build = if build_tag == "p" then "profiling"
+ else "\"" ++ build_tag ++ "\""
+ in
+ ptext (sLit "Perhaps you haven't installed the ") <> text build <>
+ ptext (sLit " libraries for package ") <> ppr pkg <> char '?' $$
+ not_found files
+
+ | otherwise
+ = ptext (sLit "There are files missing in the ") <> ppr pkg <>
+ ptext (sLit " package,") $$
+ ptext (sLit "try running 'ghc-pkg check'.") $$
+ not_found files
+
not_found files
| verbosity dflags < 3
= ptext (sLit "Use -v to see a list of the files searched for.")