From: Simon Marlow Date: Tue, 6 Oct 2009 15:49:40 +0000 (+0000) Subject: Packages are only shadowed if the InstalledPackageId is *different* X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=45a8d0ceac35f657e8f367a0e0870f2df0acde93 Packages are only shadowed if the InstalledPackageId is *different* If the two InstalledPackageIds are the same, then the packages are interchangeable and we don't need to explicitly remove one of them. --- diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index 4b14462..4c22b34 100644 --- a/compiler/main/Packages.lhs +++ b/compiler/main/Packages.lhs @@ -556,12 +556,13 @@ shadowPackages pkgs preferred in listToFM shadowed where check (shadowed,pkgmap) pkg - | Just oldpkg <- lookupUFM pkgmap (packageConfigId pkg) - = let - ipid_new = installedPackageId pkg - ipid_old = installedPackageId oldpkg - in - if ipid_old `elem` preferred + | Just oldpkg <- lookupUFM pkgmap (packageConfigId pkg), + let + ipid_new = installedPackageId pkg + ipid_old = installedPackageId oldpkg, + -- + ipid_old /= ipid_new + = if ipid_old `elem` preferred then ( (ipid_new, ShadowedBy ipid_old) : shadowed, pkgmap ) else ( (ipid_old, ShadowedBy ipid_new) : shadowed, pkgmap' ) | otherwise