diff options
author | Ian Lynagh <igloo@earth.li> | 2009-11-08 21:07:01 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2009-11-08 21:07:01 +0000 |
commit | 7f4b8d9bfbfb0556d51ba1fb25f18e424bd5bf9c (patch) | |
tree | 89aaa19b0a4f652fd9629e0ca8a1c51b7f7afe9f /libraries | |
parent | ebaa8c99e67440522c619b2ee8c250191b5d1397 (diff) | |
download | haskell-7f4b8d9bfbfb0556d51ba1fb25f18e424bd5bf9c.tar.gz |
Put docs into versioned directory names; fixes trac #3532
You can now have multiple versions of a package installed, and
gen_contents_index will do the right thing.
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/gen_contents_index | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index index 99efc8fcc6..e189cac8ee 100644 --- a/libraries/gen_contents_index +++ b/libraries/gen_contents_index @@ -3,28 +3,35 @@ set -e HADDOCK_ARGS= -NAMES= case $* in --inplace) HADDOCK=../inplace/bin/haddock - HADDOCK_FILES=`ls -1 */dist-install/doc/html/*/*.haddock | sort` - HADDOCK_FILES="$HADDOCK_FILES `ls -1 dph/*/dist-install/doc/html/*/*.haddock | sort`" + HADDOCK_FILES1=`ls -1 */dist-install/doc/html/*/*.haddock | sort` + HADDOCK_FILES2=`ls -1 dph/*/dist-install/doc/html/*/*.haddock | sort` + HADDOCK_FILES="$HADDOCK_FILES1 $HADDOCK_FILES2" + for HADDOCK_FILE in $HADDOCK_FILES + do + LIBPATH=`echo "$HADDOCK_FILE" | sed 's#/dist-install.*##'` + NAME=`echo "$HADDOCK_FILE" | sed 's#.*/##' | sed 's#\.haddock$##'` + VERSION=`grep -i '^version:' $LIBPATH/$NAME.cabal | sed 's/.*[ \t]//'` + HADDOCK_ARG="--read-interface=${NAME}-${VERSION},$HADDOCK_FILE" + HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG" + done ;; *) - HADDOCK=../../../../bin/haddock + HADDOCK=../../../../../bin/haddock # We don't want the GHC API to swamp the index - HADDOCK_FILES=`ls -1 */*.haddock | grep -v "ghc/" | sort` + HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort` + for HADDOCK_FILE in $HADDOCK_FILES + do + NAME_VERSION=`echo "$HADDOCK_FILE" | sed 's#/.*##'` + HADDOCK_ARG="--read-interface=${NAME_VERSION},$HADDOCK_FILE" + HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG" + done ;; esac -for HADDOCK_FILE in $HADDOCK_FILES -do - NAME=` echo "$HADDOCK_FILE" | sed 's#.*/##' | sed 's#\.haddock$##' ` - HADDOCK_ARGS="$HADDOCK_ARGS --read-interface=$NAME,$HADDOCK_FILE" - NAMES="$NAMES $NAME" -done - # Now create the combined contents and index pages $HADDOCK --gen-index --gen-contents -o . \ -t "Haskell Hierarchical Libraries" \ |