[commit: ghc] wip/nfs-locking: Adapt to Cabal library changes (10154e7)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 01:09:47 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/10154e73137208ba1808c4b19a9e507e0943de8f/ghc

>---------------------------------------------------------------

commit 10154e73137208ba1808c4b19a9e507e0943de8f
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Mon Oct 3 09:30:05 2016 +0100

    Adapt to Cabal library changes


>---------------------------------------------------------------

10154e73137208ba1808c4b19a9e507e0943de8f
 src/Rules/Cabal.hs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/Rules/Cabal.hs b/src/Rules/Cabal.hs
index ed72f93..e12ab33 100644
--- a/src/Rules/Cabal.hs
+++ b/src/Rules/Cabal.hs
@@ -1,10 +1,11 @@
 module Rules.Cabal (cabalRules) where
 
-import Data.Version
 import Distribution.Package as DP
 import Distribution.PackageDescription
 import Distribution.PackageDescription.Parse
+import Distribution.Text
 import Distribution.Verbosity
+import Text.PrettyPrint
 
 import Base
 import Expression
@@ -22,9 +23,8 @@ cabalRules = do
             need [pkgCabalFile pkg]
             pd <- liftIO . readPackageDescription silent $ pkgCabalFile pkg
             let identifier          = package . packageDescription $ pd
-                version             = showVersion . pkgVersion $ identifier
-                DP.PackageName name = DP.pkgName identifier
-            return $ name ++ " == " ++ version
+                version             = render . disp . pkgVersion $ identifier
+            return $ unPackageName (DP.pkgName identifier) ++ " == " ++ version
         writeFileChanged out . unlines $ constraints
 
     -- Cache package dependencies.
@@ -38,7 +38,7 @@ cabalRules = do
                 let depsLib  = collectDeps $ condLibrary pd
                     depsExes = map (collectDeps . Just . snd) $ condExecutables pd
                     deps     = concat $ depsLib : depsExes
-                    depNames = [ name | Dependency (DP.PackageName name) _ <- deps ]
+                    depNames = [ unPackageName name | Dependency name _ <- deps ]
                 return . unwords $ pkgNameString pkg : sort depNames
         writeFileChanged out . unlines $ pkgDeps
 



More information about the ghc-commits mailing list