Skip to content

Commit

Permalink
Correct the order of args given by --PROG-options
Browse files Browse the repository at this point in the history
They were getting reversed. Problem located by Igloo.
  • Loading branch information
dcoutts committed Jul 10, 2008
1 parent 31342e9 commit 597ee5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Distribution/Simple.hs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ buildAction :: UserHooks -> BuildFlags -> Args -> IO ()
buildAction hooks flags args = do
let distPref = fromFlag $ buildDistPref flags
lbi <- getBuildConfigIfUpToDate distPref
let progs = foldr (uncurry userSpecifyArgs)
let progs = foldl userSpecifyArgs'
(withPrograms lbi) (buildProgramArgs flags)
where userSpecifyArgs' conf (prog, args') =
userSpecifyArgs prog args' conf
hookedAction preBuild buildHook postBuild
(return lbi { withPrograms = progs })
hooks flags args
Expand Down
6 changes: 4 additions & 2 deletions Distribution/Simple/Configure.hs
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,11 @@ configure (pkg_descr0, pbi) cfg
createDirectoryIfMissingVerbose (lessVerbose verbosity) True distPref

let programsConfig =
flip (foldr (uncurry userSpecifyArgs)) (configProgramArgs cfg)
. flip (foldr (uncurry userSpecifyPath)) (configProgramPaths cfg)
flip (foldl userSpecifyArgs') (configProgramArgs cfg)
. flip (foldl userSpecifyPath') (configProgramPaths cfg)
$ configPrograms cfg
userSpecifyArgs' conf (prog, args) = userSpecifyArgs prog args conf
userSpecifyPath' conf (prog, path) = userSpecifyPath prog path conf
userInstall = fromFlag (configUserInstall cfg)
defaultPackageDB | userInstall = UserPackageDB
| otherwise = GlobalPackageDB
Expand Down

0 comments on commit 597ee5d

Please sign in to comment.