Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implement the 'inherit' setting.

  • Loading branch information...
commit 215e3683cd1267a846cb53eaa27d172e77f92bbd 1 parent a5c1f21
@23Skidoo 23Skidoo authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 cabal-install/Distribution/Client/PackageEnvironment.hs
View
10 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]
Please sign in to comment.
Something went wrong with that request. Please try again.