[commit: Cabal] master: Read package descriptions from the index as UTF8 (0868561)
Ian Lynagh
igloo at earth.li
Fri Jun 24 01:50:54 CEST 2011
Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/08685618e1ba33f9d7cb3c2c4f50f46eb94f6e00
>---------------------------------------------------------------
commit 08685618e1ba33f9d7cb3c2c4f50f46eb94f6e00
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