[commit: ghc] master: ghc-cabal: Inline removed function from Cabal. (f744261)
git at git.haskell.org
git at git.haskell.org
Wed Oct 25 08:31:16 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/f744261ad25942e8a747821fc468f1a21c9c705c/ghc
>---------------------------------------------------------------
commit f744261ad25942e8a747821fc468f1a21c9c705c
Author: Tamar Christina <tamar at zhox.com>
Date: Wed Oct 25 09:30:52 2017 +0100
ghc-cabal: Inline removed function from Cabal.
>---------------------------------------------------------------
f744261ad25942e8a747821fc468f1a21c9c705c
utils/ghc-cabal/Main.hs | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index e445520..4ad1187 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -15,9 +15,10 @@ import Distribution.Simple.GHC
import Distribution.Simple.Program
import Distribution.Simple.Program.HcPkg
import Distribution.Simple.Setup (ConfigFlags(configStripLibs), fromFlag, toFlag)
-import Distribution.Simple.Utils (defaultPackageDesc, writeFileAtomic, toUTF8)
+import Distribution.Simple.Utils (defaultPackageDesc, writeFileAtomic)
import Distribution.Simple.Build (writeAutogenFiles)
import Distribution.Simple.Register
+import Distribution.Utils.String (encodeStringUtf8)
import Distribution.Text
import Distribution.Types.MungedPackageId
import Distribution.Verbosity
@@ -27,6 +28,7 @@ import qualified Distribution.Simple.PackageIndex as PackageIndex
import Control.Exception (bracket)
import Control.Monad
import qualified Data.ByteString.Lazy.Char8 as BS
+import Data.Char (chr)
import Data.List
import Data.Maybe
import System.IO
@@ -456,3 +458,8 @@ generate directory distdir config_args
writeFileUtf8 f txt = withFile f WriteMode $ \hdl -> do
hSetEncoding hdl utf8
hPutStr hdl txt
+
+-- | Was removed from Cabal so inline the old definition since
+-- there isn't a 1-1 replacement for this.
+toUTF8 :: String -> String
+toUTF8 = map (chr . fromIntegral) . encodeStringUtf8
More information about the ghc-commits
mailing list