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
( OS(..), buildOS, buildArch )
import Distribution.Version
( Version(..), orLaterVersion, withinRange, isSpecificVersion, isAnyVersion
, LowerBound(..), asVersionIntervals )
, LowerBound(..), asVersionIntervals, simplifyVersionRange )
import Distribution.Verbosity
( Verbosity, lessVerbose )
......@@ -330,8 +330,10 @@ configure (e_pkg_descr, pbi) cfg
of Right r -> return r
Left missing ->
die $ "At least the following dependencies are missing:\n"
++ (render . nest 4 . sep . punctuate comma $
map disp missing)
++ (render . nest 4 . sep . punctuate comma)
[ disp (Dependency name range')
| Dependency name range <- missing
, let range' = simplifyVersionRange range ]
Right pd -> return (pd,[])
-- 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