MERGED: Define and use $httptopdir for the haddock docs locations
[ghc-hetmet.git] / compiler / main / Packages.lhs
index 1402db1..0b77983 100644 (file)
@@ -268,9 +268,12 @@ mungePackagePaths top_dir ps = map munge_pkg ps
   munge_paths = map munge_path
 
   munge_path p 
-         | Just p' <- maybePrefixMatch "$topdir" p = top_dir ++ p'
+         | Just p' <- maybePrefixMatch "$topdir"     p =            top_dir ++ p'
+         | Just p' <- maybePrefixMatch "$httptopdir" p = toHttpPath top_dir ++ p'
          | otherwise                               = p
 
+  toHttpPath p = "file:///" ++ p
+
 
 -- -----------------------------------------------------------------------------
 -- Modify our copy of the package database based on a package flag