[commit: packages/Cabal] ghc-head: Add a programOverrideEnv to the ConfiguredProgram (b0f08f4)

git at git.haskell.org git at git.haskell.org
Mon Aug 26 23:29:32 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=b0f08f462c684d24da19135c9aa457957707e99c

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

commit b0f08f462c684d24da19135c9aa457957707e99c
Author: Duncan Coutts <duncan at community.haskell.org>
Date:   Sat Aug 10 21:28:30 2013 +0100

    Add a programOverrideEnv to the ConfiguredProgram
    
    And use it in programInvocation. So configured programs can have
    environment var overrides that will be used in all invocations, like
    the existing support for default and override arguments.


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

b0f08f462c684d24da19135c9aa457957707e99c
 Cabal/Distribution/Simple/Program/Db.hs    |    1 +
 Cabal/Distribution/Simple/Program/Run.hs   |    3 ++-
 Cabal/Distribution/Simple/Program/Types.hs |    6 ++++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/Cabal/Distribution/Simple/Program/Db.hs b/Cabal/Distribution/Simple/Program/Db.hs
index c01cf74..14efacc 100644
--- a/Cabal/Distribution/Simple/Program/Db.hs
+++ b/Cabal/Distribution/Simple/Program/Db.hs
@@ -291,6 +291,7 @@ configureProgram verbosity prog conf = do
             programVersion      = version,
             programDefaultArgs  = [],
             programOverrideArgs = userSpecifiedArgs prog conf,
+            programOverrideEnv  = [],
             programLocation     = location
           }
       extraArgs <- programPostConf prog verbosity configuredProg
diff --git a/Cabal/Distribution/Simple/Program/Run.hs b/Cabal/Distribution/Simple/Program/Run.hs
index deb654b..15b58c6 100644
--- a/Cabal/Distribution/Simple/Program/Run.hs
+++ b/Cabal/Distribution/Simple/Program/Run.hs
@@ -85,7 +85,8 @@ programInvocation prog args =
     progInvokePath = programPath prog,
     progInvokeArgs = programDefaultArgs prog
                   ++ args
-                  ++ programOverrideArgs prog
+                  ++ programOverrideArgs prog,
+    progInvokeEnv  = programOverrideEnv prog
   }
 
 
diff --git a/Cabal/Distribution/Simple/Program/Types.hs b/Cabal/Distribution/Simple/Program/Types.hs
index 0e41d53..dfa6b6c 100644
--- a/Cabal/Distribution/Simple/Program/Types.hs
+++ b/Cabal/Distribution/Simple/Program/Types.hs
@@ -84,6 +84,11 @@ data ConfiguredProgram = ConfiguredProgram {
        -- all earlier flags.
        programOverrideArgs :: [String],
 
+       -- | Override environment variables for this program.
+       -- These env vars will extend\/override the prevailing environment of
+       -- the current to form the environment for the new process.
+       programOverrideEnv :: [(String, Maybe String)],
+
        -- | Location of the program. eg. @\/usr\/bin\/ghc-6.4@
        programLocation :: ProgramLocation
      } deriving (Read, Show, Eq)
@@ -127,5 +132,6 @@ simpleConfiguredProgram name loc = ConfiguredProgram {
      programVersion      = Nothing,
      programDefaultArgs  = [],
      programOverrideArgs = [],
+     programOverrideEnv  = [],
      programLocation     = loc
   }





More information about the ghc-commits mailing list