From 2429d1be7d12f93d87287dc7a42528ec3a996b44 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sat, 8 Jan 2005 16:37:09 +0000 Subject: [PATCH] [project @ 2005-01-08 16:37:09 by krasimir] system is replaced with rawSystem. This allows to use path names with embeded spaces under Windows. This is the same story as with hsc2hs but ghc-pkg is used only with GHC, so the change will not affect other compilers. Cabal uses "Program Files" as default installation path and this manifests the bug. --- ghc/utils/ghc-pkg/Main.hs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 880bc4b..13a4d85 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -23,6 +23,7 @@ import Distribution.ParseUtils ( showError ) import Distribution.Package import Distribution.Version import Compat.Directory ( getAppUserDataDirectory ) +import Compat.RawSystem ( rawSystem ) import Control.Exception ( evaluate ) import qualified Control.Exception as Exception @@ -46,8 +47,7 @@ import Data.Char ( isSpace ) import Monad import Directory import System ( getArgs, getProgName, - system, exitWith, - ExitCode(..) + exitWith, ExitCode(..) ) import System.IO import Data.List ( isPrefixOf, isSuffixOf, intersperse ) @@ -603,15 +603,12 @@ autoBuildGHCiLib dir batch_file ghci_file = do batch_lib_file = dir ++ '/':batch_file hPutStr stderr ("building GHCi library " ++ ghci_lib_file ++ "...") #if defined(darwin_TARGET_OS) - r <- system("ld -r -x -o " ++ ghci_lib_file ++ - " -all_load " ++ batch_lib_file) + r <- rawSystem "ld" ["-r","-x","-o",ghci_lib_file,"-all_load",batch_lib_file] #elif defined(mingw32_HOST_OS) execDir <- getExecDir "/bin/ghc-pkg.exe" - r <- system (maybe "" (++"/gcc-lib/") execDir++"ld -r -x -o " ++ - ghci_lib_file ++ " --whole-archive " ++ batch_lib_file) + r <- rawSystem (maybe "" (++"/gcc-lib/") execDir++"ld") ["-r","-x","-o",ghci_lib_file,"--whole-archive",batch_lib_file] #else - r <- system("ld -r -x -o " ++ ghci_lib_file ++ - " --whole-archive " ++ batch_lib_file) + r <- rawSystem "ld" ["-r","-x","-o",ghci_lib_file,"--whole-archive",batch_lib_file] #endif when (r /= ExitSuccess) $ exitWith r hPutStrLn stderr (" done.") -- 1.7.10.4