Skip to content

Commit

Permalink
Change dependencyInconsistencies to not take the pseudo top package
Browse files Browse the repository at this point in the history
The one case where we need the pseudo top package we can use
PackageIndex.insert instead to get the same effect and there
are other cases in cabal-install where we do not want a pseudo
top package.
  • Loading branch information
dcoutts committed May 4, 2008
1 parent de4f77a commit f9ef0a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Distribution/Simple/Configure.hs
Expand Up @@ -356,7 +356,9 @@ configure (pkg_descr0, pbi) cfg
InstalledPackageInfo.package = packageId pkg_descr,
InstalledPackageInfo.depends = dep_pkgs
}
case PackageIndex.dependencyInconsistencies packageDependsIndex pseudoTopPkg of
case PackageIndex.dependencyInconsistencies
. PackageIndex.insert pseudoTopPkg
$ packageDependsIndex of
[] -> return ()
inconsistencies ->
warn verbosity $
Expand Down
5 changes: 2 additions & 3 deletions Distribution/Simple/PackageIndex.hs
Expand Up @@ -281,17 +281,16 @@ dependencyClosure index pkgids0 = case closure [] [] pkgids0 of
--
dependencyInconsistencies :: PackageFixedDeps pkg
=> PackageIndex pkg
-> pkg
-> [(String, [(PackageIdentifier, Version)])]
dependencyInconsistencies index topPkg =
dependencyInconsistencies index =
[ (name, inconsistencies)
| (name, uses) <- Map.toList inverseIndex
, let inconsistencies = duplicatesBy uses
, not (null inconsistencies) ]

where inverseIndex = Map.fromListWith (++)
[ (packageName dep, [(packageId pkg, packageVersion dep)])
| pkg <- topPkg : allPackages index
| pkg <- allPackages index
, dep <- depends pkg ]

duplicatesBy = (\groups -> if length groups == 1
Expand Down

0 comments on commit f9ef0a3

Please sign in to comment.