diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-10-06 13:14:56 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-10-06 13:14:56 +0000 |
commit | 6199781240ee68bc2250a91517b1cc3c7a514332 (patch) | |
tree | cfa872b4d7e6d1bc40f0817bab9167e07a344313 /utils/ghc-cabal | |
parent | 8f95c6c82b6aa365d940d2a96df9cc672c1fedb1 (diff) | |
download | haskell-6199781240ee68bc2250a91517b1cc3c7a514332.tar.gz |
follow changes in Distribution.Simple.PackageIndex API
Diffstat (limited to 'utils/ghc-cabal')
-rw-r--r-- | utils/ghc-cabal/ghc-cabal.hs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/utils/ghc-cabal/ghc-cabal.hs b/utils/ghc-cabal/ghc-cabal.hs index 29e0f5c500..f724617c6a 100644 --- a/utils/ghc-cabal/ghc-cabal.hs +++ b/utils/ghc-cabal/ghc-cabal.hs @@ -223,15 +223,15 @@ doInstall ghc ghcpkg topdir directory distDir progs' = updateProgram ghcProg $ updateProgram ghcPkgProg progs instInfos <- dump verbosity ghcPkgProg GlobalPackageDB - let installedPkgs' = PackageIndex.listToInstalledPackageIndex - instInfos + let installedPkgs' = PackageIndex.fromList instInfos let mlc = libraryConfig lbi mlc' = case mlc of Just lc -> - let cipds = componentInstalledPackageDeps lc - cipds' = map (fixupPackageId instInfos) cipds + let cipds = componentPackageDeps lc + cipds' = [ (fixupPackageId instInfos ipid, pid) + | (ipid,pid) <- cipds ] in Just $ lc { - componentInstalledPackageDeps = cipds' + componentPackageDeps = cipds' } Nothing -> Nothing lbi' = lbi { @@ -335,12 +335,11 @@ generate config_args distdir directory -- stricter than gnu ld). Thus we remove the ldOptions for -- GHC's rts package: hackRtsPackage index = - case PackageIndex.lookupInstalledPackageByName index (PackageName "rts") of - [rts] -> PackageIndex.addToInstalledPackageIndex rts { Installed.ldOptions = [] } index + case PackageIndex.lookupPackageName index (PackageName "rts") of + [(_,[rts])] -> PackageIndex.insert rts{ Installed.ldOptions = [] } index _ -> error "No (or multiple) ghc rts package is registered!!" - dep_ids = map (packageId.getLocalPackageInfo lbi) $ - externalPackageDeps lbi + dep_ids = map snd (externalPackageDeps lbi) let variablePrefix = directory ++ '_':distdir let xs = [variablePrefix ++ "_VERSION = " ++ display (pkgVersion (package pd)), |