Permalink
Browse files

Cosmetic changes.

  • Loading branch information...
1 parent 8240388 commit d9318dfd7e9df3d606073c3fc28c51492358fb75 @23Skidoo committed May 31, 2012
Showing with 5 additions and 7 deletions.
  1. +5 −7 haddock-gen-index.py
View
@@ -5,8 +5,8 @@
# Change this to the appropriate version.
GHC_DIR = "C:\\ghc\\ghc-7.4.1"
-TOPDIR = GHC_DIR + "\\lib"
-LIBRARIES_DIR = GHC_DIR + "\\doc\\html\\libraries"
+LIB_DIR = GHC_DIR + "\\lib"
+LIB_DOC_DIR = GHC_DIR + "\\doc\\html\\libraries"
def get_field(pkg, fld):
ret = subprocess.check_output(["ghc-pkg", "field", pkg, fld])
@@ -16,18 +16,16 @@ def get_field(pkg, fld):
pkgs = subprocess.check_output(["ghc-pkg", "list", "--simple-output"]).split()
for pkg in pkgs:
html = os.path.abspath(get_field(pkg, "haddock-html"))
- html = html.replace(TOPDIR, "..\\..\\..\\lib")
- html = html.replace(LIBRARIES_DIR, ".")
+ html = html.replace(LIB_DIR, "..\\..\\..\\lib")
+ html = html.replace(LIB_DOC_DIR, ".")
intf = os.path.abspath(get_field(pkg, "haddock-interfaces"))
valid = True
- if pkg.startswith("ghc-"):
+ if any(pkg.startswith(prefix) for prefix in ["ghc-", "rts-", "hoopl-"]):
valid = False
if pkg.startswith("ghc-prim-"):
valid = True
- if pkg.startswith("rts-"):
- valid = False
if not os.path.isfile(intf):
valid = False
print "Invalid interface: " + intf

0 comments on commit d9318df

Please sign in to comment.