summaryrefslogtreecommitdiff
path: root/compiler/main/PackageConfig.hs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-05-10 22:55:52 +0000
committerIan Lynagh <igloo@earth.li>2008-05-10 22:55:52 +0000
commite25d5095e6fd47e0a02404d9532c2f776d3f8a32 (patch)
treede95d4775cd4ace077cf55fcfecbeb011a8b372b /compiler/main/PackageConfig.hs
parentabfbfafac4f4713d106a214be1c5237b61b7c5e2 (diff)
downloadhaskell-e25d5095e6fd47e0a02404d9532c2f776d3f8a32.tar.gz
Follow changes in Cabal
Diffstat (limited to 'compiler/main/PackageConfig.hs')
-rw-r--r--compiler/main/PackageConfig.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/main/PackageConfig.hs b/compiler/main/PackageConfig.hs
index 80488ec05f..d5569c4a85 100644
--- a/compiler/main/PackageConfig.hs
+++ b/compiler/main/PackageConfig.hs
@@ -8,7 +8,7 @@ module PackageConfig (
-- * The PackageConfig type: information about a package
PackageConfig,
- InstalledPackageInfo_(..), showPackageId,
+ InstalledPackageInfo_(..), display,
Version(..),
PackageIdentifier(..),
defaultPackageConfig,
@@ -16,9 +16,10 @@ module PackageConfig (
#include "HsVersions.h"
-import Module
+import Module
import Distribution.InstalledPackageInfo
import Distribution.Package
+import Distribution.Text
import Distribution.Version
import Distribution.Compat.ReadP ( readP_to_S )
@@ -45,14 +46,14 @@ defaultPackageConfig = emptyInstalledPackageInfo
-- A PackageId is a string of the form <pkg>-<version>.
mkPackageId :: PackageIdentifier -> PackageId
-mkPackageId = stringToPackageId . showPackageId
+mkPackageId = stringToPackageId . display
packageConfigId :: PackageConfig -> PackageId
packageConfigId = mkPackageId . package
unpackPackageId :: PackageId -> Maybe PackageIdentifier
unpackPackageId p
- = case [ pid | (pid,"") <- readP_to_S parsePackageId str ] of
+ = case [ pid | (pid,"") <- readP_to_S parse str ] of
[] -> Nothing
(pid:_) -> Just pid
where str = packageIdString p