From: rrt Date: Wed, 13 Jun 2001 15:50:25 +0000 (+0000) Subject: [project @ 2001-06-13 15:50:25 by rrt] X-Git-Tag: Approximately_9120_patches~1766 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ea47b6e651e0e8d441fa934965217954b33643ee;p=ghc-hetmet.git [project @ 2001-06-13 15:50:25 by rrt] Stop using kludgedSystem; the new Windows implementation of system works instead. --- diff --git a/ghc/compiler/main/DriverFlags.hs b/ghc/compiler/main/DriverFlags.hs index 146cfa6..50692f0 100644 --- a/ghc/compiler/main/DriverFlags.hs +++ b/ghc/compiler/main/DriverFlags.hs @@ -1,7 +1,7 @@ {-# OPTIONS -#include "hschooks.h" #-} ----------------------------------------------------------------------------- --- $Id: DriverFlags.hs,v 1.56 2001/05/31 11:32:25 simonmar Exp $ +-- $Id: DriverFlags.hs,v 1.57 2001/06/13 15:50:25 rrt Exp $ -- -- Driver flags -- @@ -22,7 +22,7 @@ module DriverFlags ( import DriverState import DriverUtil -import TmpFiles ( v_TmpDir, kludgedSystem ) +import TmpFiles ( v_TmpDir ) import CmdLineOpts import Config import Util @@ -543,7 +543,7 @@ runSomething phase_name cmd unless n $ do -- and run it! - exit_code <- kludgedSystem cmd phase_name + exit_code <- system cmd if exit_code /= ExitSuccess then throwDyn (PhaseFailed phase_name exit_code) diff --git a/ghc/compiler/main/TmpFiles.hs b/ghc/compiler/main/TmpFiles.hs index a1eae3b..3c50aec 100644 --- a/ghc/compiler/main/TmpFiles.hs +++ b/ghc/compiler/main/TmpFiles.hs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: TmpFiles.hs,v 1.21 2001/05/29 17:53:59 sof Exp $ +-- $Id: TmpFiles.hs,v 1.22 2001/06/13 15:50:25 rrt Exp $ -- -- Temporary file management -- @@ -15,8 +15,7 @@ module TmpFiles ( newTempName, -- :: Suffix -> IO FilePath addFilesToClean, -- :: [FilePath] -> IO () removeTmpFiles, -- :: Int -> [FilePath] -> IO () - v_TmpDir, - kludgedSystem + v_TmpDir ) where -- main @@ -88,37 +87,12 @@ removeTmpFiles verb fs = do (do when verbose (hPutStrLn stderr ("Removing: " ++ f)) if '*' `elem` f #if defined(mingw32_TARGET_OS) && defined(MINIMAL_UNIX_DEPS) - then kludgedSystem (unwords [cRM, dosifyPath f]) "Cleaning temp files" >> return () + then system (unwords [cRM, dosifyPath f]) >> return () #else - then kludgedSystem (unwords [cRM, f]) "Cleaning temp files" >> return () + then system (unwords [cRM, f]) >> return () #endif else removeFile f) `catchAllIO` (\_ -> when verbose (hPutStrLn stderr ("Warning: can't remove tmp file " ++ f))) mapM_ blowAway fs - - --- system that works feasibly under Windows (i.e. passes the command line to sh, --- because system() under Windows doesn't look at SHELL, and always uses CMD.EXE) -kludgedSystem cmd phase_name - = do -#if !defined(mingw32_TARGET_OS) || defined(MINIMAL_UNIX_DEPS) - -- in the case where we do want to use an MSDOS command shell, we assume - -- that files and paths have been converted to a form that's - -- understandable to the command we're invoking. - exit_code <- system cmd `catchAllIO` - (\_ -> throwDyn (PhaseFailed phase_name (ExitFailure 1))) -#else - pid <- myGetProcessID - tmp_dir <- readIORef v_TmpDir - let tmp = tmp_dir++"/sh"++show pid - h <- openFile tmp WriteMode - hPutStrLn h cmd - hClose h - exit_code <- system ("sh - " ++ tmp) `catchAllIO` - (\_ -> removeFile tmp >> - throwDyn (PhaseFailed phase_name (ExitFailure 1))) - removeFile tmp -#endif - return exit_code