[Pkg-haskell-commits] darcs: haskell-hoogle: Rework how the database is generated

Iustin Pop iustin at debian.org
Sun Sep 21 19:23:44 UTC 2014


Sun Sep 21 19:12:59 UTC 2014  Iustin Pop <iustin at debian.org>
  * Rework how the database is generated
  
  This finally updates the update-hoogle script to the new way of handling
  database in newer hoogle. Unfortunately, we do this by completely skipping the
  'data' subcommand, since that wants a fixed list of (big) files, and we instead
  convert and combine the packages manually. The script did this before, but only
  for the local database; the 'keyword' db was handled by 'data', which is now
  also moved to convert/combine.
  
  This patch needs an updated keyword.txt file.
  

    M ./changelog +2
    M ./files_hoogle/update-hoogle -9 +6

Sun Sep 21 19:12:59 UTC 2014  Iustin Pop <iustin at debian.org>
  * Rework how the database is generated
  
  This finally updates the update-hoogle script to the new way of handling
  database in newer hoogle. Unfortunately, we do this by completely skipping the
  'data' subcommand, since that wants a fixed list of (big) files, and we instead
  convert and combine the packages manually. The script did this before, but only
  for the local database; the 'keyword' db was handled by 'data', which is now
  also moved to convert/combine.
  
  This patch needs an updated keyword.txt file.
  
diff -rN -u old-haskell-hoogle/changelog new-haskell-hoogle/changelog
--- old-haskell-hoogle/changelog	2014-09-21 19:23:44.334273961 +0000
+++ new-haskell-hoogle/changelog	2014-09-21 19:23:44.354273962 +0000
@@ -3,6 +3,8 @@
   * Switch from embedded to packaged jquery
   * Fix Vcs-* fields to point to anonscm
   * Fix autopkgtests definition to eliminate spurious failures
+  * Rework the database generation so that it doesn't download files from
+    the internet, making it (again) hermetic (Closes: #756334).
 
  -- Iustin Pop <iustin at debian.org>  Mon, 28 Jul 2014 02:18:39 +0200
 
diff -rN -u old-haskell-hoogle/files_hoogle/update-hoogle new-haskell-hoogle/files_hoogle/update-hoogle
--- old-haskell-hoogle/files_hoogle/update-hoogle	2014-09-21 19:23:44.334273961 +0000
+++ new-haskell-hoogle/files_hoogle/update-hoogle	2014-09-21 19:23:44.342273960 +0000
@@ -6,20 +6,13 @@
   done
 }
 
+SHIPPED_DIR=/usr/share/hoogle/predownload
 DATABASE_DIR=/var/lib/hoogle/databases
 HOOGLE=/usr/bin/hoogle
 
 # cleanup
 rm -rf $DATABASE_DIR/*
 
-# copy (fake) files
-mkdir -p $DATABASE_DIR/download/hackage-cabal
-cd $DATABASE_DIR/download && touch hackage-cabal.txt hackage-hoogle.txt haskell-platform.cabal base.txt ghc.txt
-cp /usr/share/hoogle/predownload/keyword.txt $DATABASE_DIR/download/
-
-# new database
-$HOOGLE data keyword
-
 # convert
 echo -n "Converting databases."
 TXTFILES_SYM=`find /usr/lib/ghc-doc/hoogle/ -name "*.txt"`
@@ -30,8 +23,12 @@
     $HOOGLE convert $i $DATABASE_DIR/`basename $i`.hoo --addlocation >/dev/null 2>&1
   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
+# 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




More information about the Pkg-haskell-commits mailing list