@@ -175,7 +175,9 @@ import Text.PrettyPrint
175
175
, char
176
176
, colon
177
177
, hsep
178
+ , int
178
179
, nest
180
+ , parens
179
181
, quotes
180
182
, renderStyle
181
183
, text
@@ -897,10 +899,11 @@ configurePackage cfg lbc0 pkg_descr00 flags enabled comp platform programDb0 pac
897
899
(merged, ds@ (dup : _)) ->
898
900
noticeDoc verbosity $
899
901
vcat
900
- [ (text " The build tool" <+> quotes (text $ nameOf dup) <+> " has multiple versions specified" ) <> colon
901
- , nest 2 $ vcat [char ' -' <+> text (prettyShow $ versionOf d) | d <- ds]
902
- , text " These versions have been combined as" <> colon
903
- , nest 2 $ quotes (text $ prettyShow merged)
902
+ [ (text " As the build tool" <+> quotes (text $ nameOf dup) <+> " was specified more than once" ) <> colon
903
+ , nest 2 $ vcat [char ' -' <+> versionOfDoc d | d <- ds]
904
+ , (text " We'll use the effective intersection of these" <+> int (length ds) <+> " version ranges" ) <> colon
905
+ , nest 2 $ char ' -' <+> versionOfDoc merged
906
+ , text " Please specify build tool dependencies only once."
904
907
]
905
908
906
909
programDb1 <-
@@ -958,6 +961,12 @@ nameOf (LegacyExeDependency n _) = n
958
961
versionOf :: LegacyExeDependency -> VersionRange
959
962
versionOf (LegacyExeDependency _ v) = v
960
963
964
+ versionOfDoc :: LegacyExeDependency -> Doc
965
+ versionOfDoc (LegacyExeDependency _ v) =
966
+ if v == anyVersion
967
+ then text (prettyShow v) <+> parens (text " any version" )
968
+ else text $ prettyShow v
969
+
961
970
-- | Any duplicates in the list has their version range merged by intersection.
962
971
-- The second list has the build tool with its merged version range and its list
963
972
-- of duplicates.
0 commit comments