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