[commit: ghc] wip/nfs-locking: Add pkgHaddockPath for finding haddock files. (0aedb12)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:18:10 UTC 2017


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

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

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

commit 0aedb12d7790c167f3550b59c3303f8874c8af3c
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Wed Aug 19 02:38:31 2015 +0100

    Add pkgHaddockPath for finding haddock files.


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

0aedb12d7790c167f3550b59c3303f8874c8af3c
 src/Settings/TargetDirectory.hs | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/Settings/TargetDirectory.hs b/src/Settings/TargetDirectory.hs
index 0844d14..10f0f67 100644
--- a/src/Settings/TargetDirectory.hs
+++ b/src/Settings/TargetDirectory.hs
@@ -1,7 +1,8 @@
 module Settings.TargetDirectory (
-    targetDirectory, targetPath
+    targetDirectory, targetPath, pkgHaddockPath
     ) where
 
+import Base
 import Util
 import Stage
 import Package
@@ -14,3 +15,9 @@ targetDirectory = userTargetDirectory
 -- Path to the target directory from GHC source root
 targetPath :: Stage -> Package -> FilePath
 targetPath stage pkg = pkgPath pkg -/- targetDirectory stage pkg
+
+-- Relative path to a package haddock file, e.g.:
+-- "libraries/array/dist-install/doc/html/array/array.haddock"
+pkgHaddockPath :: Package -> FilePath
+pkgHaddockPath pkg @ (Package name _) =
+    targetPath Stage1 pkg -/- "doc/html" -/- name -/- name <.> "haddock"



More information about the ghc-commits mailing list