Commit 35b6bda9 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Apply 'sandboxInstallPolicy' after 'reinstallTargets'.

Otherwise 'install --reinstall' in a sandbox reinstall the contents of the whole
sandbox.
parent d819ef72
......@@ -34,7 +34,7 @@ module Distribution.Client.Dependency (
PackageSpecifier(..),
-- ** Sandbox policy
sandboxInstallPolicy,
applySandboxInstallPolicy,
-- ** Extra policy options
dontUpgradeBasePackage,
......@@ -321,14 +321,12 @@ standardInstallPolicy
$ basicDepResolverParams
installedPkgIndex sourcePkgIndex
sandboxInstallPolicy :: SandboxPackageInfo
-> InstalledPackageIndex.PackageIndex
-> SourcePackageDb
-> [PackageSpecifier SourcePackage]
-> DepResolverParams
sandboxInstallPolicy
(SandboxPackageInfo modifiedDeps otherDeps allSandboxPkgs)
installedPkgIndex sourcePackageDb pkgSpecifiers
applySandboxInstallPolicy :: SandboxPackageInfo
-> DepResolverParams
-> DepResolverParams
applySandboxInstallPolicy
(SandboxPackageInfo modifiedDeps otherDeps allSandboxPkgs)
params
= addPreferences [ PackageInstalledPreference n PreferInstalled
| n <- installedNotModified ]
......@@ -347,7 +345,7 @@ sandboxInstallPolicy
-- We don't need to add source packages for add-source deps to the
-- 'installedPkgIndex' since 'getSourcePackages' did that for us.
$ standardInstallPolicy installedPkgIndex sourcePackageDb pkgSpecifiers
$ params
where
installedPkgIds =
......
......@@ -328,9 +328,11 @@ planPackages comp platform mSandboxPkgInfo solver
[ PackageConstraintStanzas (pkgSpecifierTarget pkgSpecifier) stanzas
| pkgSpecifier <- pkgSpecifiers ]
. maybe id applySandboxInstallPolicy mSandboxPkgInfo
. (if reinstall then reinstallTargets else id)
$ (maybe standardInstallPolicy sandboxInstallPolicy mSandboxPkgInfo)
$ standardInstallPolicy
installedPkgIndex sourcePkgDb pkgSpecifiers
stanzas = concat
......
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