Skip to content
Snippets Groups Projects
Commit e97c387e authored by Isaac Potoczny-Jones's avatar Isaac Potoczny-Jones
Browse files

patch from krasimir for escaping spaces

BUGFIX: System.Cmd.system was used here but the executable path may
have spaces.  The right way is to use runInteractiveProcess but it isn't
supported from HUGS.  It is easier for a while to quote the path.
parent 5f8837e3
No related branches found
No related tags found
No related merge requests found
...@@ -227,8 +227,8 @@ getInstalledPackages :: Compiler -> Bool -> Int -> IO [PackageIdentifier] ...@@ -227,8 +227,8 @@ getInstalledPackages :: Compiler -> Bool -> Int -> IO [PackageIdentifier]
getInstalledPackages comp user verbose = do getInstalledPackages comp user verbose = do
when (verbose > 0) $ message "Reading installed packages..." when (verbose > 0) $ message "Reading installed packages..."
withTempFile "." "" $ \tmp -> do withTempFile "." "" $ \tmp -> do
let user_flag = if user then " --user" else " --global" let user_flag = if user then "--user" else "--global"
cmd_line = compilerPkgTool comp ++ user_flag ++ " list >" ++ tmp cmd_line = "\"" ++ compilerPkgTool comp ++ "\" " ++ user_flag ++ " list >" ++ tmp
when (verbose > 0) $ when (verbose > 0) $
putStrLn cmd_line putStrLn cmd_line
res <- system cmd_line res <- system cmd_line
...@@ -335,7 +335,7 @@ compilerPkgToolName cmp = error $ "Unsupported compiler: " ++ (show cmp) ...@@ -335,7 +335,7 @@ compilerPkgToolName cmp = error $ "Unsupported compiler: " ++ (show cmp)
configCompilerVersion :: CompilerFlavor -> FilePath -> Int -> IO Version configCompilerVersion :: CompilerFlavor -> FilePath -> Int -> IO Version
configCompilerVersion GHC compilerP verbose = configCompilerVersion GHC compilerP verbose =
withTempFile "." "" $ \tmp -> do withTempFile "." "" $ \tmp -> do
let cmd_line = compilerP ++ " --version >" ++ tmp let cmd_line = "\"" ++ compilerP ++ "\" --version >" ++ tmp
when (verbose > 0) $ when (verbose > 0) $
putStrLn cmd_line putStrLn cmd_line
maybeExit $ system cmd_line maybeExit $ system cmd_line
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment