Commit 68d3da7b authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Fix handling of unadorned package names

ie make "cabal install xmonad" work ;-)
We were parsing unqalified package names as a dependency upon a specific but
empty version. That is treating "foo" as a dependency like "foo==".
We now treat unadroned package names as deps on any version.
parent d1bb3665
......@@ -7,7 +7,7 @@ import Distribution.ParseUtils
, field, liftField, readFields
, showDependency, parseDependency
, warning, lineNo, locatedErrorMsg)
import Distribution.Version (Dependency(..), VersionRange(..))
import Distribution.Version (Version(..), Dependency(..), VersionRange(..))
import Control.Exception
import Control.Monad (foldM, liftM, guard)
......@@ -93,4 +93,6 @@ showDependencies = concat . intersperse ", " . map (show . showDependency)
parseDependencyOrPackageId :: ReadP r Dependency
parseDependencyOrPackageId = parseDependency +++ liftM pkgToDep parsePackageId
where pkgToDep p = Dependency (pkgName p) (ThisVersion (pkgVersion p))
\ No newline at end of file
where pkgToDep p = case pkgVersion p of
Version [] _ -> Dependency (pkgName p) AnyVersion
version -> Dependency (pkgName p) (ThisVersion version)
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