[DHG_packages] 07/15: hoogle: Rewrite `update-hoogle' script to work with the latest version
Ilias Tsitsimpis
iliastsi-guest at moszumanska.debian.org
Sun Oct 30 16:52:34 UTC 2016
This is an automated email from the git hooks/post-receive script.
iliastsi-guest pushed a commit to branch master
in repository DHG_packages.
commit ac90cc582652a7aa10e4af1539afc41a53b24ec5
Author: Ilias Tsitsimpis <i.tsitsimpis at gmail.com>
Date: Thu Oct 27 22:34:04 2016 +0300
hoogle: Rewrite `update-hoogle' script to work with the latest version
---
p/haskell-hoogle/debian/changelog | 1 +
p/haskell-hoogle/debian/files_hoogle/update-hoogle | 31 +++++++---------------
2 files changed, 10 insertions(+), 22 deletions(-)
diff --git a/p/haskell-hoogle/debian/changelog b/p/haskell-hoogle/debian/changelog
index 8b83a1e..de6011a 100644
--- a/p/haskell-hoogle/debian/changelog
+++ b/p/haskell-hoogle/debian/changelog
@@ -15,6 +15,7 @@ haskell-hoogle (5.0.1-3) UNRELEASED; urgency=medium
* Patch hoogle to accept the `--local' flag more than once.
This enables hoogle to generate docs for more than one packages
at the same database. Debian uses this in the update-hoogle command.
+ * Rewrite `update-hoogle' script to work with the latest version.
-- Ilias Tsitsimpis <i.tsitsimpis at gmail.com> Fri, 28 Oct 2016 13:02:02 +0300
diff --git a/p/haskell-hoogle/debian/files_hoogle/update-hoogle b/p/haskell-hoogle/debian/files_hoogle/update-hoogle
index fb9001c..f10fdff 100755
--- a/p/haskell-hoogle/debian/files_hoogle/update-hoogle
+++ b/p/haskell-hoogle/debian/files_hoogle/update-hoogle
@@ -1,12 +1,5 @@
#!/bin/sh
-readlinks() {
- for i in $*; do
- readlink -f $i
- done
-}
-
-SHIPPED_DIR=/usr/share/hoogle/predownload
DATABASE_DIR=/var/lib/hoogle/databases
HOOGLE=/usr/bin/hoogle
@@ -14,21 +7,15 @@ HOOGLE=/usr/bin/hoogle
rm -rf $DATABASE_DIR/*
# convert
-echo -n "Converting databases."
+echo -n "Converting databases..."
TXTFILES_SYM=`find /usr/lib/ghc-doc/hoogle/ -name "*.txt"`
-TXTFILES=`readlinks $TXTFILES_SYM`
-for i in $TXTFILES; do
- if [ -r "$i" ]; then
- echo -n "."
- $HOOGLE convert $i $DATABASE_DIR/`basename $i`.hoo --addlocation >/dev/null 2>&1
- fi
+LOCALS=""
+for i in $TXTFILES_SYM; do
+ TXTFILE=$(readlink -f $i)
+ if [ -r "$TXTFILE" ]; then
+ LOCALS="$LOCALS --local=$(dirname $TXTFILE)"
+ fi
done
-# convert the pre-shipped keyword file (no addlocation here!)
-$HOOGLE convert $SHIPPED_DIR/keyword.txt $DATABASE_DIR/keyword.txt.hoo >/dev/null 2>&1
-echo " done"
-# combine, removing first default.hoo (if by any chance the above
-# commands generated one)
-rm -f $DATABASE_DIR/default.hoo
-find $DATABASE_DIR -name \*.hoo -print0 | \
- xargs -0 -- hoogle combine -o $DATABASE_DIR/default.hoo
+$HOOGLE generate --database=$DATABASE_DIR/default.hoo $LOCALS > /dev/null 2>&1
+echo " done"
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/DHG_packages.git
More information about the Pkg-haskell-commits
mailing list