[DHG_packages] 08/15: hoogle: Patch hoogle to use the Debian database

Ilias Tsitsimpis iliastsi-guest at moszumanska.debian.org
Sun Oct 30 16:52:35 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 dc61b73e3e7a361fcc97eee8b3ec2f6a2d66974c
Author: Ilias Tsitsimpis <i.tsitsimpis at gmail.com>
Date:   Thu Oct 27 23:00:48 2016 +0300

    hoogle: Patch hoogle to use the Debian database
---
 p/haskell-hoogle/debian/changelog               |  1 +
 p/haskell-hoogle/debian/patches/global_database | 29 +++++++++++++++++++++++++
 p/haskell-hoogle/debian/patches/series          |  1 +
 3 files changed, 31 insertions(+)

diff --git a/p/haskell-hoogle/debian/changelog b/p/haskell-hoogle/debian/changelog
index de6011a..1159254 100644
--- a/p/haskell-hoogle/debian/changelog
+++ b/p/haskell-hoogle/debian/changelog
@@ -16,6 +16,7 @@ haskell-hoogle (5.0.1-3) UNRELEASED; urgency=medium
     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.
+  * Patch hoogle to use the Debian database by default.
 
  -- Ilias Tsitsimpis <i.tsitsimpis at gmail.com>  Fri, 28 Oct 2016 13:02:02 +0300
 
diff --git a/p/haskell-hoogle/debian/patches/global_database b/p/haskell-hoogle/debian/patches/global_database
new file mode 100644
index 0000000..36bf15a
--- /dev/null
+++ b/p/haskell-hoogle/debian/patches/global_database
@@ -0,0 +1,29 @@
+Description: Use Debian's hoogle database
+ Allow hoogle to fall back to the Debian's global database
+ if the default doesn't exist.
+Author: Ilias Tsitsimpis <i.tsitsimpis at gmail.com>
+Forwarded: no, Debian specific
+
+Index: b/src/Action/CmdLine.hs
+===================================================================
+--- a/src/Action/CmdLine.hs
++++ b/src/Action/CmdLine.hs
+@@ -71,9 +71,17 @@ getCmdLine args = do
+     args <- withArgs args $ cmdArgsRun cmdLineMode
+ 
+     -- fill in the default database
++    -- If a database has not been given, and the default does not exist,
++    -- and this is not a generate command, fallback to the Debian database.
+     args <- if database args /= "" then return args else do
+         dir <- getAppUserDataDirectory "hoogle"
+-        return $ args{database=dir </> "default-" ++ lower (show $ language args) ++ "-" ++ showVersion version ++ ".hoo"}
++        let db = dir </> "default-" ++ lower (show $ language args) ++ "-    " ++ showVersion version ++ ".hoo"
++            debdb = "/var/lib/hoogle/databases/default.hoo"
++        db_exists <- doesFileExist db
++        case args of
++          Generate{..} -> return $ args{database=db}
++          _ | db_exists -> return $ args{database=db}
++          _ -> return $ args{database=debdb}
+ 
+     -- fix up people using Hoogle 4 instructions
+     args <- case args of
diff --git a/p/haskell-hoogle/debian/patches/series b/p/haskell-hoogle/debian/patches/series
index 4d4ccf0..4c3dac8 100644
--- a/p/haskell-hoogle/debian/patches/series
+++ b/p/haskell-hoogle/debian/patches/series
@@ -1 +1,2 @@
 generate_from_multiple_sources
+global_database

-- 
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