X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fghc-pkg%2FMain.hs;h=f79ebab67783b39712779bc28b744f05730aa55c;hb=9721c56a206a342c00d623817a2bb4da77755582;hp=3babd7493daeaf883ddc35f5688607790d8f867b;hpb=6627a4b1ce5863e98b78afb2d030ebf3b349d0ba;p=ghc-hetmet.git diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 3babd74..f79ebab 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -61,7 +61,11 @@ import System.Posix hiding (fdToHandle) import IO ( isPermissionError ) import System.Posix.Internals +#if __GLASGOW_HASKELL__ >= 611 +import GHC.IO.Handle.FD (fdToHandle) +#else import GHC.Handle (fdToHandle) +#endif #if defined(GLOB) import System.Process(runInteractiveCommand) @@ -356,7 +360,7 @@ parseGlobPackageId = parse +++ (do n <- parse - string "-*" + _ <- string "-*" return (PackageIdentifier{ pkgName = n, pkgVersion = globVersion })) -- globVersion means "all versions" @@ -502,7 +506,7 @@ readParseDatabase mb_user_conf filename | otherwise = do str <- readFile filename let packages = map convertPackageInfoIn $ read str - Exception.evaluate packages + _ <- Exception.evaluate packages `catchError` \e-> die ("error while parsing " ++ filename ++ ": " ++ show e) return (filename,packages) @@ -809,7 +813,7 @@ checkConsistency my_flags = do else do when (not simple_output) $ do reportError ("There are problems in package " ++ display (package p) ++ ":") - reportValidateErrors es " " Nothing + _ <- reportValidateErrors es " " Nothing return () return [p] @@ -1243,8 +1247,8 @@ installSignalHandlers = do (Exception.ErrorCall "interrupted") -- #if !defined(mingw32_HOST_OS) - installHandler sigQUIT (Catch interrupt) Nothing - installHandler sigINT (Catch interrupt) Nothing + _ <- installHandler sigQUIT (Catch interrupt) Nothing + _ <- installHandler sigINT (Catch interrupt) Nothing return () #elif __GLASGOW_HASKELL__ >= 603 -- GHC 6.3+ has support for console events on Windows @@ -1256,7 +1260,7 @@ installSignalHandlers = do sig_handler Break = interrupt sig_handler _ = return () - installHandler (Catch sig_handler) + _ <- installHandler (Catch sig_handler) return () #else return () -- nothing @@ -1338,8 +1342,12 @@ openNewFile dir template = do oflags = rw_flags .|. o_EXCL +#if __GLASGOW_HASKELL__ < 611 + withFilePath = withCString +#endif + findTempName x = do - fd <- withCString filepath $ \ f -> + fd <- withFilePath filepath $ \ f -> c_open f oflags 0o666 if fd < 0 then do