[commit: Cabal] master: Read package descriptions from the index as UTF8 (514f038)
Paolo Capriotti
p.capriotti at gmail.com
Mon May 7 23:59:25 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/514f0380ddc16b8f1653a6dae04785a7e3259748
>---------------------------------------------------------------
commit 514f0380ddc16b8f1653a6dae04785a7e3259748
Author: Duncan Coutts <duncan at haskell.org>
Date: Mon Feb 25 13:33:57 2008 +0000
Read package descriptions from the index as UTF8
>---------------------------------------------------------------
cabal-install/Hackage/IndexUtils.hs | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/cabal-install/Hackage/IndexUtils.hs b/cabal-install/Hackage/IndexUtils.hs
index d3fd2a9..f533ec3 100644
--- a/cabal-install/Hackage/IndexUtils.hs
+++ b/cabal-install/Hackage/IndexUtils.hs
@@ -25,7 +25,7 @@ import Distribution.Simple.PackageIndex (PackageIndex)
import qualified Distribution.Simple.PackageIndex as PackageIndex
import Distribution.PackageDescription.Parse (parsePackageDescription, ParseResult(..))
import Distribution.Verbosity (Verbosity)
-import Distribution.Simple.Utils (die, warn, intercalate)
+import Distribution.Simple.Utils (die, warn, intercalate, fromUTF8)
import Prelude hiding (catch)
import Control.Exception (catch, Exception(IOException))
@@ -59,7 +59,8 @@ readRepoIndex verbosity repo =
if takeExtension (tarFileName hdr) == ".cabal"
then case splitDirectories (normalise (tarFileName hdr)) of
[pkgname,vers,_] ->
- let parsed = parsePackageDescription (BS.Char8.unpack content)
+ let parsed = parsePackageDescription
+ (fromUTF8 . BS.Char8.unpack $ content)
descr = case parsed of
ParseOk _ d -> d
_ -> error $ "Couldn't read cabal file "
More information about the Cvs-libraries
mailing list