From: Simon Marlow Date: Wed, 23 Jan 2008 16:07:03 +0000 (+0000) Subject: FIX #1750: in isBrokenPackage, don't loop if the deps are recursive X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=bc81a6a5d88d4e7cfe4489755c2a17e416472788 FIX #1750: in isBrokenPackage, don't loop if the deps are recursive --- diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 416ecc1..6fa1e6b 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -720,11 +720,16 @@ missingPackageDeps :: InstalledPackageInfo -> [PackageIdentifier] missingPackageDeps pkg pkg_map = [ d | d <- depends pkg, isNothing (lookup d pkg_map)] ++ - [ d | d <- depends pkg, Just p <- return (lookup d pkg_map), isBrokenPackage p pkg_map] + [ d | d <- depends pkg, Just p <- return (lookup d pkg_map), + isBrokenPackage p pkg_map] isBrokenPackage :: InstalledPackageInfo -> [(PackageIdentifier, InstalledPackageInfo)] -> Bool -isBrokenPackage pkg pkg_map = not . null $ missingPackageDeps pkg pkg_map - +isBrokenPackage pkg pkg_map + = not . null $ missingPackageDeps pkg (filter notme pkg_map) + where notme (p,ipi) = package pkg /= p + -- remove p from the database when we invoke missingPackageDeps, + -- because we want mutually recursive groups of package to show up + -- as broken. (#1750) -- ----------------------------------------------------------------------------- -- Manipulating package.conf files