[commit: packages/Cabal] ghc-head: Initialise 'configInstallDirs' properly when loading sandbox config. (81a752b)

git at git.haskell.org git at git.haskell.org
Fri Sep 13 17:55:13 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=81a752bc50d121977937029b37856468ca3abd22

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

commit 81a752bc50d121977937029b37856468ca3abd22
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Sun Sep 8 04:53:11 2013 +0200

    Initialise 'configInstallDirs' properly when loading sandbox config.
    
    Fixes #1482.


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

81a752bc50d121977937029b37856468ca3abd22
 .../Distribution/Client/Sandbox/PackageEnvironment.hs     |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs b/cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs
index 656b35d..5c00e26 100644
--- a/cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs
+++ b/cabal-install/Distribution/Client/Sandbox/PackageEnvironment.hs
@@ -322,12 +322,25 @@ tryLoadSandboxPackageEnvironmentFile verbosity pkgEnvFile configFileFlag = do
   -- Layer the package environment settings over settings from ~/.cabal/config.
   cabalConfig <- loadConfig verbosity configFileFlag NoFlag
   return (sandboxDir,
+          updateInstallDirs $
           (base `mappend` (toPkgEnv cabalConfig) `mappend`
            common `mappend` inherited `mappend` user)
           `overrideSandboxSettings` pkgEnv)
     where
       toPkgEnv config = mempty { pkgEnvSavedConfig = config }
 
+      updateInstallDirs pkgEnv =
+        let config         = pkgEnvSavedConfig pkgEnv
+            configureFlags = savedConfigureFlags config
+            installDirs    = savedUserInstallDirs config
+        in pkgEnv {
+          pkgEnvSavedConfig = config {
+             savedConfigureFlags = configureFlags {
+                configInstallDirs = installDirs
+                }
+             }
+          }
+
 -- | Should the generated package environment file include comments?
 data IncludeComments = IncludeComments | NoComments
 




More information about the ghc-commits mailing list