[commit: packages/Cabal] ghc-head: Apply 'sandboxInstallPolicy' after 'reinstallTargets'. (35b6bda)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:25:25 CEST 2013


Repository : ssh://git@git.haskell.org/Cabal

On branch  : ghc-head
Link       : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=35b6bda936849cf400b4f9b50b8ffe06977f7801

>---------------------------------------------------------------

commit 35b6bda936849cf400b4f9b50b8ffe06977f7801
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Fri May 17 21:33:20 2013 +0200

    Apply 'sandboxInstallPolicy' after 'reinstallTargets'.
    
    Otherwise 'install --reinstall' in a sandbox reinstall the contents of the whole
    sandbox.


>---------------------------------------------------------------

35b6bda936849cf400b4f9b50b8ffe06977f7801
 cabal-install/Distribution/Client/Dependency.hs |   18 ++++++++----------
 cabal-install/Distribution/Client/Install.hs    |    4 +++-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/cabal-install/Distribution/Client/Dependency.hs b/cabal-install/Distribution/Client/Dependency.hs
index d772759..679e40a 100644
--- a/cabal-install/Distribution/Client/Dependency.hs
+++ b/cabal-install/Distribution/Client/Dependency.hs
@@ -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 =
diff --git a/cabal-install/Distribution/Client/Install.hs b/cabal-install/Distribution/Client/Install.hs
index 1b4b43b..ea276e7 100644
--- a/cabal-install/Distribution/Client/Install.hs
+++ b/cabal-install/Distribution/Client/Install.hs
@@ -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





More information about the ghc-commits mailing list