- traceCmd phase_name (concat (intersperse " " (pgm:real_args))) $ do
- exit_code <- rawSystem pgm real_args
+ -- Don't assume that 'pgm' contains the program path only,
+ -- but split it up and shift any arguments over to the arg vector.
+ let (real_pgm, argv) =
+ case toArgs pgm of
+ [] -> (pgm, real_args) -- let rawSystem be the bearer of bad news..
+ (x:xs) -> (x, xs ++ real_args)
+ traceCmd phase_name (unwords (pgm:real_args)) $ do
+ exit_code <- rawSystem real_pgm argv