Commit f6feb199 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Remove now-unused InstallPlan.preexisting

We only ever switch Configured to Installed. The PreExisting state only
comes from the original solver plan, which only uses installed packages
from the global db.
parent 0de4177c
......@@ -33,7 +33,6 @@ module Distribution.Client.InstallPlan (
fromSolverInstallPlan,
configureInstallPlan,
remove,
preexisting,
installed,
lookup,
directDeps,
......@@ -291,26 +290,6 @@ remove shouldRemove plan =
newIndex = Graph.fromList $
filter (not . shouldRemove) (toList plan)
-- | Replace a ready package with a pre-existing one. The pre-existing one
-- must have exactly the same dependencies as the source one was configured
-- with.
--
preexisting :: (IsUnit ipkg,
IsUnit srcpkg)
=> UnitId
-> ipkg
-> GenericInstallPlan ipkg srcpkg
-> GenericInstallPlan ipkg srcpkg
preexisting pkgid ipkg plan = plan'
where
plan' = plan {
planIndex = Graph.insert (PreExisting ipkg)
-- ...but be sure to use the *old* IPID for the lookup for
-- the preexisting record
. Graph.deleteKey pkgid
$ planIndex plan
}
-- | Change a package in a 'Configured' state to an 'Installed' state.
--
-- To preserve invariants, the package must have all of its dependencies
......
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