Commit d1a59a92 authored by simonpj's avatar simonpj
Browse files

[project @ 2005-01-27 12:16:51 by simonpj]

Fix handling of dependent packages without a version
parent dae341f5
......@@ -626,19 +626,28 @@ updatePackageDB
-> IO [InstalledPackageInfo]
updatePackageDB db_stack pkgs new_pkg = do
let
-- we update dependencies without version numbers to
-- match the actual versions of the relevant packages instaled.
-- The input package spec is allowed to give a package dependency
-- without a version number; e.g.
-- depends: base
-- Here, we update these dependencies without version numbers to
-- match the actual versions of the relevant packages installed.
updateDeps p = p{depends = map resolveDep (depends p)}
resolveDep pkgid
| realVersion pkgid = pkgid
| otherwise = lookupDep (pkgName pkgid)
-- = pkgid
resolveDep dep_pkgid
| realVersion dep_pkgid = dep_pkgid
| otherwise = lookupDep dep_pkgid
lookupDep name
= my_head "dep" [ pid | p <- concat (map snd db_stack),
lookupDep dep_pkgid
= let
name = pkgName dep_pkgid
in
case [ pid | p <- concat (map snd db_stack),
let pid = package p,
pkgName pid == name ]
pkgName pid == name ] of
(pid:_) -> pid -- Found installed package,
-- replete with its version
[] -> dep_pkgid -- No installed package; use
-- the version-less one
is_exposed = exposed new_pkg
pkgid = package new_pkg
......
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