X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=utils%2Fghc-pkg%2FMain.hs;h=20a6a44be7e0a1891b9bc0613378b73b6727e591;hb=03edcb58482b016a8ee019a06e114c8e8c996400;hp=4c68c2b6ca69cd6806a79560c166e9ed84e7ab3d;hpb=b24d78d947b8911f1efad35333046a4514fd611e;p=ghc-hetmet.git diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 4c68c2b..20a6a44 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -38,7 +38,7 @@ import System.Directory ( doesDirectoryExist, getDirectoryContents, import System.Exit ( exitWith, ExitCode(..) ) import System.Environment ( getArgs, getProgName, getEnv ) import System.IO -import System.IO.Error (try, isDoesNotExistError) +import System.IO.Error import Data.List import Control.Concurrent @@ -63,8 +63,6 @@ import GHC.ConsoleHandler import System.Posix hiding (fdToHandle) #endif -import IO ( isPermissionError ) - #if defined(GLOB) import System.Process(runInteractiveCommand) import qualified System.Info(os) @@ -1322,7 +1320,7 @@ checkHSLib dirs auto_ghci_libs lib = do case m of Nothing -> verror ForceFiles ("cannot find " ++ batch_lib_file ++ " on library path") - Just dir -> liftIO $ checkGHCiLib dirs dir batch_lib_file lib auto_ghci_libs + Just dir -> liftIO $ checkGHCiLib dir batch_lib_file lib auto_ghci_libs doesFileExistOnPath :: String -> [FilePath] -> IO (Maybe FilePath) doesFileExistOnPath file path = go path @@ -1348,13 +1346,10 @@ checkModules pkg = do when (isNothing m) $ verror ForceFiles ("file " ++ file ++ " is missing") -checkGHCiLib :: [String] -> String -> String -> String -> Bool -> IO () -checkGHCiLib dirs batch_lib_dir batch_lib_file lib auto_build +checkGHCiLib :: String -> String -> String -> Bool -> IO () +checkGHCiLib batch_lib_dir batch_lib_file lib auto_build | auto_build = autoBuildGHCiLib batch_lib_dir batch_lib_file ghci_lib_file - | otherwise = do - m <- doesFileExistOnPath ghci_lib_file dirs - when (isNothing m && ghci_lib_file /= "HSrts.o") $ - warn ("warning: can't find GHCi lib " ++ ghci_lib_file) + | otherwise = return () where ghci_lib_file = lib <.> "o"