diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-08-20 11:09:20 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-08-20 11:09:20 +0000 |
commit | 72547264724117d689a7fa400104185557fb2a0c (patch) | |
tree | c57b694c7ce7b0997df2595de5695230c7f9869e /compiler/main/PackageConfig.hs | |
parent | 21c5c9c09a8d36b4ae8a83b17b543c332bc9cb0c (diff) | |
download | haskell-72547264724117d689a7fa400104185557fb2a0c.tar.gz |
Add unique package identifiers (InstalledPackageId) in the package DB
See commentary at
http://hackage.haskell.org/trac/ghc/wiki/Commentary/Packages
Diffstat (limited to 'compiler/main/PackageConfig.hs')
-rw-r--r-- | compiler/main/PackageConfig.hs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/compiler/main/PackageConfig.hs b/compiler/main/PackageConfig.hs index f3cede68da..79521c7df7 100644 --- a/compiler/main/PackageConfig.hs +++ b/compiler/main/PackageConfig.hs @@ -7,7 +7,7 @@ module PackageConfig ( -- $package_naming -- * PackageId - mkPackageId, packageConfigId, unpackPackageId, + mkPackageId, packageConfigId, -- * The PackageConfig type: information about a package PackageConfig, @@ -28,7 +28,6 @@ import Distribution.ModuleName import Distribution.Package hiding (PackageId) import Distribution.Text import Distribution.Version -import Distribution.Compat.ReadP -- ----------------------------------------------------------------------------- -- Our PackageConfig type is just InstalledPackageInfo from Cabal. Later we @@ -62,15 +61,6 @@ mkPackageId = stringToPackageId . display packageConfigId :: PackageConfig -> PackageId packageConfigId = mkPackageId . package --- | Try and interpret a GHC 'PackageId' as a cabal 'PackageIdentifer'. Returns @Nothing@ if --- we could not parse it as such an object. -unpackPackageId :: PackageId -> Maybe PackageIdentifier -unpackPackageId p - = case [ pid | (pid,"") <- readP_to_S parse str ] of - [] -> Nothing - (pid:_) -> Just pid - where str = packageIdString p - -- | Turn a 'PackageConfig', which contains GHC 'Module.ModuleName's into a Cabal specific -- 'InstalledPackageInfo' which contains Cabal 'Distribution.ModuleName.ModuleName's packageConfigToInstalledPackageInfo :: PackageConfig -> InstalledPackageInfo |