|
@@ -1,4 +1,5 @@
|
1
|
1
|
{-# LANGUAGE NoImplicitPrelude #-}
|
|
2
|
+{-# LANGUAGE CPP #-}
|
2
|
3
|
|
3
|
4
|
module Distribution.CurrentPackageDescription
|
4
|
5
|
( currentPackageDescription
|
|
@@ -23,7 +24,11 @@ currentPackageDescription = fmap packageDescription $ do
|
23
|
24
|
dir <- getCurrentDirectory
|
24
|
25
|
cs <- cabalFiles dir
|
25
|
26
|
case cs of
|
|
27
|
+#if MIN_VERSION_base(4,10,0)
|
|
28
|
+ (c:_) -> readGenericPackageDescription silent c
|
|
29
|
+#else
|
26
|
30
|
(c:_) -> readPackageDescription silent c
|
|
31
|
+#endif
|
27
|
32
|
[] -> error $ "Couldn't find a cabal file in the current working directory (" ++ dir ++ ")"
|
28
|
33
|
|
29
|
34
|
cabalFiles :: FilePath -> IO [FilePath]
|