aboutsummaryrefslogtreecommitdiff
path: root/CabalHelper/Licenses.hs
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2016-02-14 13:20:53 +0100
committerDaniel Gröber <dxld@darkboxed.org>2016-02-14 13:20:53 +0100
commitc2d116272b448342629e6beb73fe7a464e2245d3 (patch)
tree116fea7cbe25a365267e64560e13ae85bc4bb5e1 /CabalHelper/Licenses.hs
parent3dcff567d383ced5ca3704a0ad5bc28de3fadd6f (diff)
Cabal 1.24 readiness (GHC 8)
Diffstat (limited to 'CabalHelper/Licenses.hs')
-rw-r--r--CabalHelper/Licenses.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/CabalHelper/Licenses.hs b/CabalHelper/Licenses.hs
index eeebae7..4660c15 100644
--- a/CabalHelper/Licenses.hs
+++ b/CabalHelper/Licenses.hs
@@ -33,11 +33,15 @@ type CPackageIndex a = PackageIndex (InstalledPackageInfo_ a)
type CPackageIndex a = PackageIndex
#endif
-#if CABAL_MAJOR == 1 && CABAL_MINOR > 22
+#if CABAL_MAJOR == 1 && CABAL_MINOR >= 23
+type CInstalledPackageId = UnitId
+lookupInstalledPackageId' = lookupUnitId
+#elif CABAL_MAJOR == 1 && CABAL_MINOR > 22
type CInstalledPackageId = ComponentId
-lookupInstalledPackageId = lookupComponentId
+lookupInstalledPackageId' = lookupComponentId
#else
type CInstalledPackageId = InstalledPackageId
+lookupInstalledPackageId' = lookupInstalledPackageId
#endif
findTransitiveDependencies
@@ -50,7 +54,7 @@ findTransitiveDependencies pkgIdx set0 = go Set.empty (Set.toList set0)
go set (q : queue)
| q `Set.member` set = go set queue
| otherwise =
- case lookupInstalledPackageId pkgIdx q of
+ case lookupInstalledPackageId' pkgIdx q of
Nothing ->
-- Not found can mean that the package still needs to be
-- installed (e.g. a component of the target cabal package).
@@ -62,7 +66,7 @@ findTransitiveDependencies pkgIdx set0 = go Set.empty (Set.toList set0)
--------------------------------------------------------------------------------
getDependencyInstalledPackageIds
- :: LocalBuildInfo -> Set InstalledPackageId
+ :: LocalBuildInfo -> Set CInstalledPackageId
getDependencyInstalledPackageIds lbi =
findTransitiveDependencies (installedPkgs lbi) $
Set.fromList $ map fst $ externalPackageDeps lbi
@@ -71,7 +75,7 @@ getDependencyInstalledPackageIds lbi =
getDependencyInstalledPackageInfos
:: LocalBuildInfo -> [InstalledPackageInfo]
getDependencyInstalledPackageInfos lbi = catMaybes $
- map (lookupInstalledPackageId pkgIdx) $
+ map (lookupInstalledPackageId' pkgIdx) $
Set.toList (getDependencyInstalledPackageIds lbi)
where
pkgIdx = installedPkgs lbi