summaryrefslogtreecommitdiff
path: root/libraries/gen_contents_index
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-10-23 16:13:56 +0100
committerIan Lynagh <igloo@earth.li>2011-10-23 16:30:22 +0100
commit3b43e035190a7f41fbd08c7409b4b2b30d3973d2 (patch)
tree5f975ba149136773cf2c0956f85cbef0d0892702 /libraries/gen_contents_index
parentf67650410b4b390b3c9959efd0db57837b6c89d6 (diff)
downloadhaskell-3b43e035190a7f41fbd08c7409b4b2b30d3973d2.tar.gz
Follow cabal->Cabal rename, and fix haddock index generation
We now make use of the ghc-packages file when making the haddock index.
Diffstat (limited to 'libraries/gen_contents_index')
-rw-r--r--libraries/gen_contents_index31
1 files changed, 21 insertions, 10 deletions
diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index
index bfdf962bf4..c8d82c8da6 100644
--- a/libraries/gen_contents_index
+++ b/libraries/gen_contents_index
@@ -7,19 +7,30 @@ HADDOCK_ARGS=
case $* in
--inplace)
HADDOCK=../inplace/bin/haddock
- for LIB in `grep '^libraries/[^ ]* *- ' ../packages | sed -e 's#libraries/##' -e 's/ .*//'`
+ for REPO in `grep '^libraries/[^ ]* *- ' ../packages | sed -e 's#libraries/##' -e 's/ .*//'`
do
- HADDOCK_FILE="$LIB/dist-install/doc/html/$LIB/$LIB.haddock"
- if [ -f "$HADDOCK_FILE" ]
+ if [ -f "$REPO/ghc-packages" ]
then
- LIBPATH=`echo "$HADDOCK_FILE" | sed 's#/dist-install.*##'`
- NAME=`echo "$HADDOCK_FILE" | sed 's#.*/##' | sed 's#\.haddock$##'`
- # It's easier to portably remove tabs with tr than to try to get
- # sed to do what we want
- VERSION=`grep -i '^version:' $LIBPATH/$NAME.cabal | sed 's/.*://' | tr -d ' \t'`
- HADDOCK_ARG="--read-interface=${NAME}-${VERSION},$HADDOCK_FILE"
- HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG"
+ LIBS="`cat $REPO/ghc-packages`"
+ LIBROOT="$REPO"
+ else
+ LIBS="$REPO"
+ LIBROOT="."
fi
+ for LIB in $LIBS
+ do
+ HADDOCK_FILE="$LIBROOT/$LIB/dist-install/doc/html/$LIB/$LIB.haddock"
+ if [ -f "$HADDOCK_FILE" ]
+ then
+ LIBPATH=`echo "$HADDOCK_FILE" | sed 's#/dist-install.*##'`
+ NAME=`echo "$HADDOCK_FILE" | sed 's#.*/##' | sed 's#\.haddock$##'`
+ # It's easier to portably remove tabs with tr than to try to get
+ # sed to do what we want
+ VERSION=`grep -i '^version:' $LIBPATH/$NAME.cabal | sed 's/.*://' | tr -d ' \t'`
+ HADDOCK_ARG="--read-interface=${NAME}-${VERSION},$HADDOCK_FILE"
+ HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG"
+ fi
+ done
done
;;
*)