Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
d993696b
Commit
d993696b
authored
Mar 27, 2011
by
Duncan Coutts
Browse files
Distinguish installed constraint error messages
parent
d142d5aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/Dependency/TopDown.hs
View file @
d993696b
...
...
@@ -42,6 +42,7 @@ import Distribution.PackageDescription.Configuration
(
finalizePackageDescription
,
flattenPackageDescription
)
import
Distribution.Version
(
VersionRange
,
anyVersion
,
withinRange
,
simplifyVersionRange
,
isAnyVersion
,
UpperBound
(
..
),
asVersionIntervals
)
import
Distribution.Compiler
(
CompilerId
)
...
...
@@ -635,6 +636,7 @@ addTopLevelVersionConstraint pkgname verrange =
where
constraint
ver
_installed
=
ver
`
withinRange
`
verrange
reason
=
ExcludedByTopLevelDependency
(
Dependency
pkgname
verrange
)
NoInstalledConstraint
addTopLevelInstalledConstraint
::
PackageName
->
Constraints
...
...
@@ -645,6 +647,7 @@ addTopLevelInstalledConstraint pkgname =
where
constraint
_ver
installed
=
installed
reason
=
ExcludedByTopLevelDependency
(
Dependency
pkgname
anyVersion
)
InstalledConstraint
-- ------------------------------------------------------------
-- * Reasons for constraints
...
...
@@ -671,7 +674,8 @@ data ExclusionReason =
-- | We excluded this version of the package because it did not satisfy
-- a dependency given as an original top level input.
--
|
ExcludedByTopLevelDependency
Dependency
|
ExcludedByTopLevelDependency
Dependency
InstalledConstraint
deriving
Eq
-- | Given an excluded package and the reason it was excluded, produce a human
-- readable explanation.
...
...
@@ -685,8 +689,14 @@ showExclusionReason pkgid ExcludedByConfigureFail =
showExclusionReason
pkgid
(
ExcludedByPackageDependency
pkgid'
dep
_
)
=
display
pkgid
++
" was excluded because "
++
display
pkgid'
++
" requires "
++
displayDep
dep
showExclusionReason
pkgid
(
ExcludedByTopLevelDependency
dep
)
=
display
pkgid
++
" was excluded because of the top level dependency "
++
showExclusionReason
pkgid
(
ExcludedByTopLevelDependency
(
Dependency
pkgname
verRange
)
InstalledConstraint
)
|
isAnyVersion
verRange
=
display
pkgid
++
" was excluded because only installed instances of "
++
display
pkgname
++
" can be selected."
showExclusionReason
pkgid
(
ExcludedByTopLevelDependency
dep
_
)
=
display
pkgid
++
" was excluded because of the top level constraint "
++
displayDep
dep
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment