Permalink
Browse files

Implement the 'inherit' setting.

  • Loading branch information...
1 parent a5c1f21 commit 215e3683cd1267a846cb53eaa27d172e77f92bbd @23Skidoo 23Skidoo committed Jul 28, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 cabal-install/Distribution/Client/PackageEnvironment.hs
@@ -16,7 +16,7 @@ module Distribution.Client.PackageEnvironment (
import Distribution.Client.Config ( SavedConfig(..), baseSavedConfig,
commentSavedConfig, initialSavedConfig,
- configFieldDescriptions,
+ loadConfig, configFieldDescriptions,
installDirsFields )
import Distribution.Client.ParseUtils ( parseFields, ppFields, ppSection )
import Distribution.Client.Setup ( GlobalFlags(..), InstallFlags(..),
@@ -169,7 +169,13 @@ loadPackageEnvironment verbosity path = do
addBasePkgEnv pkgEnvDir body = do
base <- basePackageEnvironment pkgEnvDir
extra <- body
- return $ base `mappend` extra
+ case pkgEnvInherit extra of
+ NoFlag ->
+ return $ base `mappend` extra
+ (Flag confPath) -> do
+ conf <- loadConfig verbosity (Flag confPath) (Flag False)
+ let conf' = base `mappend` conf `mappend` (pkgEnvSavedConfig extra)
+ return $ extra { pkgEnvSavedConfig = conf' }
-- | Descriptions of all fields in the package environment file.
pkgEnvFieldDescrs :: [FieldDescr PackageEnvironment]

0 comments on commit 215e368

Please sign in to comment.