Commit 6930a88c authored by Duncan Coutts's avatar Duncan Coutts Committed by Edward Z. Yang
Browse files

Fix warnings arising from the package db refactoring

parent 227205e1
{-# LANGUAGE CPP #-}
-- This module deliberately defines orphan instances for now (Binary Version).
{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# OPTIONS_GHC -fno-warn-orphans -fno-warn-name-shadowing #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.PackageDb
......@@ -246,10 +246,10 @@ writeFileAtomic targetPath content = do
let (targetDir, targetName) = splitFileName targetPath
Exception.bracketOnError
(openBinaryTempFileWithDefaultPermissions targetDir $ targetName <.> "tmp")
(\(tmpPath, handle) -> hClose handle >> removeFile tmpPath)
(\(tmpPath, handle) -> do
BS.Lazy.hPut handle content
hClose handle
(\(tmpPath, hnd) -> hClose hnd >> removeFile tmpPath)
(\(tmpPath, hnd) -> do
BS.Lazy.hPut hnd content
hClose hnd
#if mingw32_HOST_OS || mingw32_TARGET_OS
renameFile tmpPath targetPath
-- If the targetPath exists then renameFile will fail
......
{-# LANGUAGE CPP, TypeSynonymInstances, FlexibleInstances, RecordWildCards,
GeneralizedNewtypeDeriving, StandaloneDeriving #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
--
-- (c) The University of Glasgow 2004-2009.
......@@ -13,7 +14,6 @@ module Main (main) where
import Version ( version, targetOS, targetARCH )
import qualified GHC.PackageDb as GhcPkg
import qualified Distribution.Simple.PackageIndex as PackageIndex
import qualified Distribution.Package as Cabal
import qualified Distribution.ModuleName as ModuleName
import Distribution.ModuleName (ModuleName)
import Distribution.InstalledPackageInfo as Cabal
......@@ -1899,10 +1899,6 @@ throwIOIO = Exception.throwIO
catchIO :: IO a -> (Exception.IOException -> IO a) -> IO a
catchIO = Exception.catch
catchError :: IO a -> (String -> IO a) -> IO a
catchError io handler = io `Exception.catch` handler'
where handler' (Exception.ErrorCall err) = handler err
tryIO :: IO a -> IO (Either Exception.IOException a)
tryIO = Exception.try
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment