Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal On branch : master
http://hackage.haskell.org/trac/ghc/changeset/0d70a875355355134da635b9d8ea97d2cfa1bd28 >--------------------------------------------------------------- commit 0d70a875355355134da635b9d8ea97d2cfa1bd28 Author: Duncan Coutts <[email protected]> Date: Wed Jun 4 12:52:17 2008 +0000 Fix for marking reverse deps of failed packages The reverse deps may have already failed due to depending on another failed package. So do not assume all reverse deps are in the configured state. If they are in the failed state then ignore them. >--------------------------------------------------------------- cabal-install/Hackage/InstallPlan.hs | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff --git a/cabal-install/Hackage/InstallPlan.hs b/cabal-install/Hackage/InstallPlan.hs index 8da4e3d..befccbd 100644 --- a/cabal-install/Hackage/InstallPlan.hs +++ b/cabal-install/Hackage/InstallPlan.hs @@ -234,8 +234,8 @@ failed pkgid buildResult buildResult' plan = assert (invariant plan') plan' failures = PackageIndex.fromList $ Failed pkg buildResult : [ Failed pkg' buildResult' - | pkgid' <- packagesThatDependOn plan pkgid - , let pkg' = lookupConfiguredPackage plan pkgid' ] + | Just pkg' <- map (lookupConfiguredPackage' plan) + $ packagesThatDependOn plan pkgid ] -- | lookup the reachable packages in the reverse dependency graph -- @@ -252,8 +252,17 @@ lookupConfiguredPackage :: InstallPlan a lookupConfiguredPackage plan pkgid = case PackageIndex.lookupPackageId (planIndex plan) pkgid of Just (Configured pkg) -> pkg - Just _ -> error $ "InstallPlan: not configured " ++ display pkgid - Nothing -> error $ "InstallPlan: no such package " ++ display pkgid + _ -> internalError $ "not configured or no such pkg " ++ display pkgid + +-- | lookup a package that we expect to be in the configured or failed state +-- +lookupConfiguredPackage' :: InstallPlan a + -> PackageIdentifier -> Maybe ConfiguredPackage +lookupConfiguredPackage' plan pkgid = + case PackageIndex.lookupPackageId (planIndex plan) pkgid of + Just (Configured pkg) -> Just pkg + Just (Failed _ reason) -> Nothing + _ -> internalError $ "not configured or no such pkg " ++ display pkgid -- ------------------------------------------------------------ -- * Checking valididy of plans _______________________________________________ Cvs-libraries mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-libraries
