import Distribution.InstalledPackageInfo
import Distribution.Package
+import Distribution.Version
import System.IO ( hPutStrLn, stderr )
-import Data.Version
import Data.Maybe ( fromJust, isNothing )
import System.Directory ( doesFileExist )
import Control.Monad ( when, foldM )
(ps,_) -> multiplePackagesErr str ps
procflags pkgs expl (IgnorePackage str : flags) = do
case partition (matches str) pkgs of
- ([],_) -> missingPackageErr str
(ps,qs) -> procflags qs expl flags
+ -- missing package is not an error for -ignore-package,
+ -- because a common usage is to -ignore-package P as
+ -- a preventative measure just in case P exists.
-- A package named on the command line can either include the
-- version, or just the name if it is unambiguous.
multiplePackagesErr str ps =
throwDyn (CmdLineError (showSDoc (
text "Error; multiple packages match" <+>
- text str <> colon <>
+ text str <> colon <+>
sep (punctuate comma (map (text.showPackageId.package) ps))
)))