Commit 0a0ff024 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Simplify version ranges before printing in configure error message

Part of ticket #369. Now instead of:
  setup: At least the following dependencies are missing:
  base <3 && <4 && <3 && <3 && <4
we get:
  setup: At least the following dependencies are missing:
  base <3
parent cf1ea287
...@@ -113,7 +113,7 @@ import Distribution.System ...@@ -113,7 +113,7 @@ import Distribution.System
( OS(..), buildOS, buildArch ) ( OS(..), buildOS, buildArch )
import Distribution.Version import Distribution.Version
( Version(..), orLaterVersion, withinRange, isSpecificVersion, isAnyVersion ( Version(..), orLaterVersion, withinRange, isSpecificVersion, isAnyVersion
, LowerBound(..), asVersionIntervals ) , LowerBound(..), asVersionIntervals, simplifyVersionRange )
import Distribution.Verbosity import Distribution.Verbosity
( Verbosity, lessVerbose ) ( Verbosity, lessVerbose )
...@@ -330,8 +330,10 @@ configure (e_pkg_descr, pbi) cfg ...@@ -330,8 +330,10 @@ configure (e_pkg_descr, pbi) cfg
of Right r -> return r of Right r -> return r
Left missing -> Left missing ->
die $ "At least the following dependencies are missing:\n" die $ "At least the following dependencies are missing:\n"
++ (render . nest 4 . sep . punctuate comma $ ++ (render . nest 4 . sep . punctuate comma)
map disp missing) [ disp (Dependency name range')
| Dependency name range <- missing
, let range' = simplifyVersionRange range ]
Right pd -> return (pd,[]) Right pd -> return (pd,[])
-- add extra include/lib dirs as specified in cfg -- add extra include/lib dirs as specified in cfg
......
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