Commit 91afc9f7 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Simplify version ranges in configure messages and errors

Part of #369
parent ab76b5c1
...@@ -71,7 +71,8 @@ import Distribution.Simple.Compiler ...@@ -71,7 +71,8 @@ import Distribution.Simple.Compiler
, showCompilerId, unsupportedExtensions, PackageDB(..), PackageDBStack ) , showCompilerId, unsupportedExtensions, PackageDB(..), PackageDBStack )
import Distribution.Package import Distribution.Package
( PackageName(PackageName), PackageId, PackageIdentifier(PackageIdentifier) ( PackageName(PackageName), PackageId, PackageIdentifier(PackageIdentifier)
, packageName, packageVersion, Package(..), Dependency(Dependency) ) , packageName, packageVersion, Package(..)
, Dependency(Dependency), simplifyDependency )
import Distribution.InstalledPackageInfo import Distribution.InstalledPackageInfo
( InstalledPackageInfo, emptyInstalledPackageInfo ) ( InstalledPackageInfo, emptyInstalledPackageInfo )
import qualified Distribution.InstalledPackageInfo as Installed import qualified Distribution.InstalledPackageInfo as Installed
...@@ -575,11 +576,12 @@ configDependency verbosity internalIndex installedIndex dep@(Dependency pkgname ...@@ -575,11 +576,12 @@ configDependency verbosity internalIndex installedIndex dep@(Dependency pkgname
`inPreferenceTo` `inPreferenceTo`
PackageIndex.lookupDependency installedIndex dep of PackageIndex.lookupDependency installedIndex dep of
[] -> die $ "cannot satisfy dependency " [] -> die $ "cannot satisfy dependency "
++ display dep ++ "\n" ++ display (simplifyDependency dep) ++ "\n"
++ "Perhaps you need to download and install it from\n" ++ "Perhaps you need to download and install it from\n"
++ hackageUrl ++ display pkgname ++ "?" ++ hackageUrl ++ display pkgname ++ "?"
pkgs -> do let pkgid = maximumBy (comparing packageVersion) (map packageId pkgs) pkgs -> do let pkgid = maximumBy (comparing packageVersion) (map packageId pkgs)
info verbosity $ "Dependency " ++ display dep info verbosity $ "Dependency "
++ display (simplifyDependency dep)
++ ": using " ++ display pkgid ++ ": using " ++ display pkgid
return pkgid return pkgid
where where
......
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